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 > Help with nested queries

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-01-04, 05:11
bondie bondie is offline
Registered User
 
Join Date: Aug 2002
Posts: 6
Help with nested queries

Hi!

I am trying to do a nested query but Pervasive kept giving me syntax error. This is what I am trying to do:

select itemno, sum(qtysold) from
(select itemno, qtysold from icitem
union all
select itemno, qtysold from oeitem)

Note that the above is not the complete query.

I heard that Pervasive cannot handle complex queries. If so, how can I go about doing a select statement from a result set?

Thanks!
Reply With Quote
  #2 (permalink)  
Old 09-03-04, 09:44
Dilyias Dilyias is offline
Registered User
 
Join Date: Feb 2004
Posts: 78
Create a temporary table, perform two inserts (one from icitem, one from oeitem). Then select from this table.

There are views, but they do not support the union keyword.

OR, if you have Sql Server you could run the grouping there. Assuming you have your client pervasive odbc dsn set up on the Sql Server box, run something like the following in Query Analyser:

select itemno, sum(qtysold) from openrowset('MSDASQL','DSN=whatever','select itemno, qtysold from icitem union all select itemno, qtysold from oeitem')
group by itemno
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