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(
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)
);
CREATE
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]
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
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.
But if 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
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 great feature.
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
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 in order
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:00:00+01;63
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,
george young gry@ll.mit.edu writes:
But not if you specify the object:
newschm3=# \d+ fffg
Table public.fffg
Column | Type | Modifiers | Description
+-+---+-
t | text| |
i | integer | |
This seems
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
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 max
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:
select case
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
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 |
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
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
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
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 extensions
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,
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 null
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)
Another table is:-chemical= select *
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 order by
25 matches
Mail list logo