[SQL] a change of query

2003-02-25 Thread James Cooper
select distinct cp.person_id from cluster_person cp, cluster c where cp.cluster_id = c.cluster_id and c.c_id = 1 can this query be changed to give just the row count?( of the distinct rows ) yes: i am aware of count() but this wont count the distinct rows - I can however achive this with an n

[SQL] Return type of triger functions from OPAQUE to TRIGGER in 7.3

2003-02-25 Thread Roberto Mello
In OpenACS, we have _a lot_ of functions, and many many triggers. Having endured the pains of trying to write upgrade scripts for functions, we were overjoyed with the addition of CREATE OR REPLACE for functions. 7.3 is looking great, so we're starting migrating towards it, with an eye on maintain

Re: [SQL] Denormalizing during select

2003-02-25 Thread Josh Berkus
Jeff, > > I have two tables (A and B) in a one-to-many relationship. When > > retrieving data from one table (A), I need to denormalize the tables > > during a select so that values of a column in the many table (B) appear > > as a list in one field of the output. > > Well, the straightforward wa

Re: [SQL] Sub Select inside Check ?

2003-02-25 Thread Stephan Szabo
On Tue, 25 Feb 2003, Rudi Starcevic wrote: > I'm trying to create this table with a Check that fails. > > I'm using 'Check' instead of 'References' due to poor db schema ( before > me .. ) > > Here is my error message: > ERROR: cannot use subselect in CHECK constraint expression > > CREATE TABLE

[SQL] how can i drop a constraint

2003-02-25 Thread rute solipa
hello, i've got some tables where constraints don't have an explicit name, how can i drop them. best regards, rute ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddress

Re: [SQL] good style?

2003-02-25 Thread Rafal Kedziorski
Tambet Matiisen wrote: - Original Message - From: "Rafal Kedziorski" <[EMAIL PROTECTED]> To: "Tambet Matiisen" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Monday, February 24, 2003 1:51 AM Subject: Re: [SQL] good style? [snip] original: Merge Join (cost=728.47..820.47 rows=1000 wi