[SQL] Unique constraints for a list

2003-08-29 Thread Anuradha Ratnaweera
Hi all, o We have a table t1 which has a primary key id and other fields. (say, 10 rows with ids 1 to 10). o We need to group rows (unordered, and arbritrary size) in t1 and assign a unique id to each group. (e.g.: {1, 3, 4} is group 1, {1, 5} is group 2 etc.) o A group shouldn't change

[SQL] Re: order of multiple assignments in UPDATE

2001-05-02 Thread Anuradha Ratnaweera
I understand that an UPDATE is done using "old" values of the variables involved so that we can write T(n + 1) = U(T(n)) where T(n) and T(n + 1) are the values of the table before and after update U. Thanks for all who pointed this out. Just as a matter of interest, I want to point out that t

[SQL] Re: Heres a good one...

2001-05-01 Thread Anuradha Ratnaweera
uld have > been because it alone met the before March 31 and update flag = H criteria. > But it is a start for me thanks. > > And your second sql statement just didn't work. It said 'ERROR: parser: > parse error at or near "select"' > > Steve > >

[SQL] Re: Heres a good one...

2001-04-29 Thread Anuradha Ratnaweera
First, posting_date in journal can _NOT_ be of type char(4)! I guess it is a "date". Try update journal set gl_update_flag='Y' from distrib where journal.gl_update_flag = 'H' and journal.posting_date <= '2001-03-31' and (journal.objectid = distrib.distrib_objectid or journal.objectid = distrib.

[SQL] order of multiple assignments in UPDATE

2001-04-29 Thread Anuradha Ratnaweera
If I have a query UPDATE tablename SET c1 = 10 - c2, c2 = 4 where ... will the two assignments be evaluated from left to right? Thanks in advance. Anuradha ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an app