dbTalk Databases Forums  

general query question.....

comp.databases.btrieve comp.databases.btrieve


Discuss general query question..... in the comp.databases.btrieve forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
James Radke
 
Posts: n/a

Default general query question..... - 10-22-2003 , 02:56 PM






Hello,

Here is my issue.. I have three tables in a pervasive 2000i SP4 database;
Customer Master, Sales Order Master and Sales Order Detail.

We are creating a query screen where we would like to return the sales order
number, customer number (on Sales Order Master table), customer name (on
Customer Master) for all orders in the database.

In Microsoft SQL land, I could write a query like:

select SalesOrderMaster.CustomerID, CustomerName, SalesOrderMaster.ORDNUM
from CustomerMaster join SalesOrderMaster on CustomerMaster.CustomerID =
SalesOrderMaster.CustomerID
where CustomerName like 'abr%'
and SalesOrderMaster.ORDNUM in (Select ORDNUM from SalesOrderDetail where
PartNumber like '586%')

This would return the unique order number, customer number and customer name
for all orders where the customer name started with 'ABR' who had a part
number that started with '586' in the detail table.

Is there a way for me to do a similar query using Pervasives SQL? If so,
how?

Thanks!

Jim



Reply With Quote
  #2  
Old   
Bill Bach
 
Posts: n/a

Default Re: general query question..... - 10-23-2003 , 03:37 PM






Your query should work, although you may need to use the keywords "INNER JOIN"
instead of just "JOIN".
Goldstar Software Inc.
Building on Btrieve(R) for the Future(SM)
Bill Bach
BillBach (AT) goldstarsoftware (DOT) com
http://www.goldstarsoftware.com
*** Pervasive.SQL Service & Support Classes ***
Chicago: November 18-20: See our web site for details!
Chicago Cubs: The Tradition Continues!

James Radke wrote:

Quote:
Hello,

Here is my issue.. I have three tables in a pervasive 2000i SP4 database;
Customer Master, Sales Order Master and Sales Order Detail.

We are creating a query screen where we would like to return the sales order
number, customer number (on Sales Order Master table), customer name (on
Customer Master) for all orders in the database.

In Microsoft SQL land, I could write a query like:

select SalesOrderMaster.CustomerID, CustomerName, SalesOrderMaster.ORDNUM
from CustomerMaster join SalesOrderMaster on CustomerMaster.CustomerID =
SalesOrderMaster.CustomerID
where CustomerName like 'abr%'
and SalesOrderMaster.ORDNUM in (Select ORDNUM from SalesOrderDetail where
PartNumber like '586%')

This would return the unique order number, customer number and customer name
for all orders where the customer name started with 'ABR' who had a part
number that started with '586' in the detail table.

Is there a way for me to do a similar query using Pervasives SQL? If so,
how?

Thanks!

Jim


Reply With Quote
Reply




Thread Tools
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.