INSERT INTO temptable (customerid)
SELECT customerid FROM invoicefile

You then have your temp table with customerIDs so can use as such 

select cust.name , cust.addr , cust.city from customerfile cust inner join
temptable temp on temp.customerid = cust.id where cust.st = 'ny'


So you can then do 
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of George Gallen
Sent: 08 April 2010 15:09
To: U2 Users List
Subject: [U2] SQL Equiv to Save-list?

Is there a way in SQL without resorting to subqueries to select a table,
then save the resulting field,
Then use that list for a future SQL query?

ex. select customerid from invoicefile;
       save the list of customerid for later use

<later>

      get that list of customerid
      select cust.name , cust.addr , cust.city, etc  from customerfile where
cust.id=(list of customerid) and cust.st='ny'


Or is this one of those pick "ain't it great we can do this" features?


George Gallen
Senior Programmer/Analyst
Accounting/Data Division, EDI Administrator
[email protected]
ph:856.848.9005 Ext 220
The Wyanoke Group
http://www.wyanokegroup.com



_______________________________________________
U2-Users mailing list
[email protected]
http://listserver.u2ug.org/mailman/listinfo/u2-users

_______________________________________________
U2-Users mailing list
[email protected]
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to