PDA

View Full Version : inner join with console



CGibson
2013-10-18, 15:53
Hello,

Can the console handle an sql query with multiple inner joins?
I've tried a few times and the following is returned on the second inner join


Unrecognized SQL phrase/keyword


Cory

yvonne.milne
2013-10-21, 06:59
Hi Cory,

It should be fine - just remember it needs to be a single line as you can't use the ; continuation in the Console.

e.g.


open database southwind
SELECT customers.customerid, customers.companyname, orders.customerid, orders.orderid, order_details.orderid, order_details.productid FROM customers INNER JOIN orders ON customers.customerid = orders.customerid, orders INNER JOIN order_details ON orders.orderid = order_details.orderid

Regards,

Yvonne

CGibson
2013-10-21, 09:19
Hi Yvonne,

Thank you for the help.
The reason I was having difficultly is because the syntax is slightly different than regular sql joins (ex. using a comma between joins).

Cory

avianmanagement
2013-10-21, 09:27
Hi Cory,

If I remember correctly from an earlier post on views I think Barry altered it so you can also use ( as in vfp for the joins.

David

yvonne.milne
2013-10-21, 09:47
Hi David,

Yes - the discussion is here: http://www.lianja.com/community/showthread.php?1374-Complex-Views.

Regards,

Yvonne

CGibson
2013-10-21, 11:11
Thank you David and Yvonne.

Cory