If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Pervasive.SQL > Query from another query?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-07-03, 11:53
nmathon nmathon is offline
Registered User
 
Join Date: Nov 2003
Location: Canada
Posts: 1
Query from another query?

Is it possible to query fields from another query with Btrieve?

Example:

SELECT T.Product, SUM(T.Cost), SUM(T.Saving)
FROM (SELECT Product, Cost, Saving FROM Products) AS T
GROUP BY T.Product
ORDER BY T.Product

Thanks in advance for your help!
Reply With Quote
  #2 (permalink)  
Old 11-08-03, 18:10
mirtheil mirtheil is offline
Registered User
 
Join Date: Dec 2001
Posts: 1,026
You can use a sub query but you can't use it to specify the table name. What exactly are you trying to do with your query?
In addition, even if it did work, the select you're using as the sub query wouldn't be guaranteed to return one field and one record which is what it would need to do in order to be a "tablename".
Doesn't:
SELECT T.Product, SUM(T.Cost), SUM(T.Saving)
FROM Products AS T
GROUP BY T.Product
ORDER BY T.Product
fulfill your needs?
__________________
Mirtheil Software
Certified Pervasive Developer
Certified Pervasive Technician
Custom Btrieve/VB development
http://www.mirtheil.com
I do not answer questions by email. Please post on the forum.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On