PDA

View Full Version : SQL - getting rowid into a temp table [368]


Art S. Kagel
06-24-2003, 11:07 AM
The problem you are having is twofold, first you cannot use a column alias in a
GROUP BY clause you would have to use the ordinal position of the columns (ie
GROUP BY 1, 2, 3,...). The second and larger problem is that you cannot use a
GROUP BY clause or ORDER BY clause if you include an INTO TEMP clause. So,
fetch the raw data to the temp table then do the GROUP BY on the temp table to
calculate whatever aggregate(s) you need.

Art S. Kagel
----- Original Message -----
From: R.... Konikoff <konikoffr@BRAGG.ARMY.MIL>
At: 6/24 13:55
Simple sql question: How do you get the rowid of a record to pass to a temp table in ISQL? I tried renaming the field in the temp table and passing it in the clear, but neither work. I understand that rowid is a transient value and that you can't use the field name rowid in the temp table (since it would have it's own)... so what can I try? Here is what I've tried before: ======= select rowid id_num, f1, f2, ... from table group by id_num, f1, f2, ... into temp tmp_table; ======= select rowid id_num, f1, f2, ... from table group by rowid, f1, f2, ... into temp tmp_table; ======= select rowid id_num, f1, f2, ... from table group by f1, f2, ... into temp tmp_table; =========== Thanks... Rob



sending to informix-list


MyLounge.com Site Map
Forum: Cars, Cell Phone, Database, Games, Home Improvement, IT, Music, School, Sports, Web Design, Web Server, Weight Loss

The MyLounge.com forum is intended for informational use only and should not be relied upon and is not a substitute for any advice. The information contained on MyLounge.com are opinions and suggestions of members and is not a representation of the opinions of MyLounge.com. MyLounge.com does not warrant or vouch for the accuracy, completeness or usefulness of any postings or the qualifications of any person responding. Please consult a expert or seek the services of an attorney in your area for more accuracy on your specific situation. Please note that our forums also serve as mirrors to Usenet newsgroups. Many posts you see on our forums are made by newsgroup users who may not be members of MyLounge.com Term of Service