AKHILESH GUPTA <[EMAIL PROTECTED]> schrieb:
> hi all,
> below I have created two tables in pgsql with field name as 'name' and 'id' as
> their datatype 'varchar(15)' and 'integer'.
> i want the output as:->
... a UNION of this 2 tables:
test=# select * from test1 union select * from test3 orde
hi all,
below I have created two tables in pgsql with field name as 'name' and 'id' as their datatype 'varchar(15)' and 'integer'.
One of the table is:->
chemical=> select * from test1;
name | id
---+
akhil | 1
b | 2
c | 3
d | 4
e | 5
f | 6
(6 rows)
Anot
"Daniel Caune" <[EMAIL PROTECTED]> writes:
> Is an index on a nullable column useful for retrieving rows having that
> column null?
Nope, because IS NULL isn't an indexable operator.
You can make an end-run around that with a partial index, eg
create index fooi on foo(f1) where f1 is nul
CREATE OR REPLACE FUNCTION foreach( liste INTEGER[] ) RETURNS SETOF
INTEGER AS $$
DECLARE
i INTEGER;
BEGIN
FOR i IN 1..icount(liste) LOOP
RETURN NEXT liste[i];
END LOOP;
END;
$$ LANGUAGE plpgsql;
CREATE AGGREGATE array_accum (
sfunc = array_append,
basetype = anyelement,
On Fri, 24 Mar 2006, Julie Robinson wrote:
> This works, but is there a better solution?
>
> select *
> from quality_control_reset T
> where date = (
> select max(date)
> from quality_control_reset
> where qualitycontrolrange = T.qualitycontrolrange);
If you can use PostgreSQL extens
Hi,
Is an index on a nullable column useful for retrieving rows having that
column null?
SELECT PlayerID
FROM PlayerLoginSession
WHERE EndTime IS NULL;
Regards,
--
Daniel CAUNE
Ubisoft Online Technology
(514) 4090 2040 ext. 5418
---(end of broadcast)
Your tips were great and I have hunted down the relevant pages in the
docs. Thanks guys!
--
Amos
On 24-Mar-06, at 4:20 PM, Rod Taylor wrote:
On Fri, 2006-03-24 at 16:20 -0500, Tom Lane wrote:
Rod Taylor <[EMAIL PROTECTED]> writes:
The reason for the subselect is to prevent multiple calcu
This works, but is there a better solution?
select *
from quality_control_reset T
where date = (
select max(date)
from quality_control_reset
where qualitycontrolrange = T.qualitycontrolrange);
Julie Robinson wrote:
Given the two tables at the bottom of this email, I'm having trouble
c
Given the two tables at the bottom of this email, I'm having trouble
coming up with a SQL statement that returns all rows in the
quality_control_reset table where there is only one row for the most
recent quality_control_range. Help?
Example:
In table quality_control_reset:
id | timesta
Good day,
Is it possible to construct an array from an appropriate select
expression that generates a result set of unknown cardinality?
To focus on the simple case: Is it possible to construct a one-
dimensional array from a select of a single column in a table with an
unknown number of ro
On Fri, 2006-03-24 at 16:20 -0500, Tom Lane wrote:
> Rod Taylor <[EMAIL PROTECTED]> writes:
> > The reason for the subselect is to prevent multiple calculations of
> > individual column aggregates. I believe it *may* be calculated multiple
> > times otherwise this would work just as well:
>
> > se
Rod Taylor <[EMAIL PROTECTED]> writes:
> The reason for the subselect is to prevent multiple calculations of
> individual column aggregates. I believe it *may* be calculated multiple
> times otherwise this would work just as well:
> select case when max(a) > max(b) then max(a) else max(b) end as m
Amos Hayes <[EMAIL PROTECTED]> writes:
> I'm trying to build a query that among other things, returns the
> minimum and maximum values contained in either of two columns.
I think you might be looking for
select greatest(max(columnA), max(columnB)) from tab;
select least(min(colu
george young writes:
> But not if you specify the object:
> newschm3=# \d+ fffg
> Table "public.fffg"
> Column | Type | Modifiers | Description
> +-+---+-
> t | text| |
> i | integer | |
> This seems a bi
On Friday 24 March 2006 21:42, Scott Marlowe wrote:
> More than likely you need a left join and a case statement.
>
> select , case when a.date is null then 0 else a.date end
> from (select * from generate_series() -- magic to get dates goes here)
> as p left join maintable as a on (p.date=a.date);
On Fri, 2006-03-24 at 15:19 -0500, Amos Hayes wrote:
> Hello. I've recently begun to use PostgreSQL in earnest (working with
> data as opposed to just having clever applications tuck it away in
> there) and have hit a wall with something.
>
> I'm trying to build a query that among other things
On Fri, 2006-03-24 at 14:30, MaXX wrote:
> Hi,
>
> I have a table wich contains aggregated data,
> table stats_activity
> logtime timestamptz,
> count int
>
> given this dataset
> "2006-03-24 03:00:00+01";55
> "2006-03-24 04:00:00+01";33
> "2006-03-24 06:00:00+01";46
> "2006-03-24 07
Hi,
I have a table wich contains aggregated data,
table stats_activity
logtime timestamptz,
count int
given this dataset
"2006-03-24 03:00:00+01";55
"2006-03-24 04:00:00+01";33
"2006-03-24 06:00:00+01";46
"2006-03-24 07:00:00+01";63
"2006-03-24 08:00:00+01";88
I want to get this
Hello. I've recently begun to use PostgreSQL in earnest (working with
data as opposed to just having clever applications tuck it away in
there) and have hit a wall with something.
I'm trying to build a query that among other things, returns the
minimum and maximum values contained in either
On Wed, 22 Mar 2006 13:07:33 -0800
Bryce Nesbitt <[EMAIL PROTECTED]> threw this fish to the penguins:
> Terry Lee Tucker wrote:
> > rnd=# \h comment
> > Command: COMMENT
> > Description: define or change the comment of an object
> > ..I believe this is what you need.
> >
> Cool!
> That's a
Todd Kennedy wrote:
They haven't responded me as of yet. There should be a band associated
with each album -- this is handled in code, but other than that this
is the only relational db way I can think of to do it.
But if a band can have songs in many albums and an album can have songs
from mu
On Fri, 24 Mar 2006 13:34:34 -0500
Joe <[EMAIL PROTECTED]> wrote:
> Todd Kennedy wrote:
> > They haven't responded me as of yet. There should be a band associated
> > with each album -- this is handled in code, but other than that this
> > is the only relational db way I can think of to do it.
>
>
We're not concerned with the track info. This is a listing of album
information, hence the one to many relationship between the album and
the artist.
and for the record, i should correct myself. he said it was "bad" not "wrong".
but i hadn't given him all the details.
But. Yes. Thank you all
They haven't responded me as of yet. There should be a band associated
with each album -- this is handled in code, but other than that this
is the only relational db way I can think of to do it.
Thanks!
Todd
On 3/24/06, D'Arcy J.M. Cain wrote:
> On Fri, 24 Mar 2006 11:52:31 -0500
> "Todd Kennedy
And I want to link the band to the album, but, if the album is a
compilation it'll be linked to multiple band.ids, so i can't just add
a column like:
For a compilation, you should link a band to a track, not an album. This
opens another can of worms...
I would use the following t
Child table references a not-existing table:
('band' insted of 'bands')
Error: ERROR: relation "band" does not exist
> CREATE TABLE bands (
> CREATE TABLE bands_on_album (
- - -
> band_id integer REFERENCES band (id),
- - -
Regards,
Milorad Poluga
[EMAIL PROTECTED]
On Fri, 24 Mar 2006 11:52:31 -0500
"Todd Kennedy" <[EMAIL PROTECTED]> wrote:
> So I've got two tables, one for albums and one for bands, for
> simplicity's sake, they look like this:
>
> CREATE TABLE bands (
> id serial PRIMARY KEY,
> name varchar(64) NOT NULL CHECK( name <> ''),
> UNIQUE(name)
>
Hi,
This should be a simple idea, but I've been going back and forth on it
with various people in my tech group.
So I've got two tables, one for albums and one for bands, for
simplicity's sake, they look like this:
CREATE TABLE bands (
id serial PRIMARY KEY,
name varchar(64) NOT NULL CHECK( name
28 matches
Mail list logo