Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Can anyone help please?
I have got 2 tables in 2 different flat files say sales, orders with a common field named ' ORDERID'.
How do I apply WHERE CLAUE to filter data across 2 tables in 2 different flat files?
How do I write the script like in SQL queries, like WHERE Sales.ORDERID = Orders.ORDERID?
DK
Hi,
A) Load first your SALES table and then the ORDERS table and use here
ORDERS:
Load OrderID, Field2
where exists (OrderID);
B) You can JOIN your tables (Inner, Outer, Left, Right ...)
See the QV help file for more detailed information.
Good luck!
Rainer
Hi there,
Thanks for that.
Option A - It works!!!! thanks a lot.
Option B - I found the QV help section unclear on joins especially when using tables from ODBC connection or external tables. I would like to understand a bit more though!.
ANOTHER QUESTION:
I have 2 flat tables say customer, orders with a common field ORDERID.
I need to create another field in Customers table say ' STATUS'. The value of this field should be 1 or 0. if ORDERID exisits for a customer then it should be 1, if not 0. How can i do that? Can I extend the EXISTS/NOT EXISTS to include this condition?
DK
Exactly. You would use EXISTS in an IF statement with 1 an 0 being conditional results.
If(exists(OrderID), 1, 0)