Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM SQL » View Thread |
Messages 1 to 3 of 3 total |
Two queries |
Fri, Jun 6 2008 11:10 AM | Permanent Link |
John | Hi.
Is it possible just with SQL to use the result of one query in another query? For instance: SELECT MAX(No) FROM Customers; SELECT * FROM SALESLINES WHERE CUSTNO={Result from first query}; |
Fri, Jun 6 2008 11:46 AM | Permanent Link |
"Robert" | "John" <eydunl@post.olivant.fo> wrote in message news:0E5DDB2F-72D5-4905-AF6D-513F36D1ED28@news.elevatesoft.com... > Hi. > > Is it possible just with SQL to use the result of one query in another > query? > > For instance: > SELECT MAX(No) FROM Customers; > SELECT * FROM SALESLINES WHERE CUSTNO={Result from first query}; > select * from salesline where custno in (select max(no) from customers) Be careful though, there are speed issues with these type subqueries. A safer way is using a script select max(no) maxno into memory\temp from customers; select * from salesline join memory\temp on maxno = custno; Robert |
Fri, Jun 6 2008 2:26 PM | Permanent Link |
John | Thanks |
This web page was last updated on Tuesday, April 30, 2024 at 03:55 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |