Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
tjardine99
Contributor
Contributor

MySQL query using Where in

I am trying to LOAD an extract from a table in MySQL using two fields from an existing table.  The two fields are the primary key for the MySQL table.  Any thoughts?

Labels (2)
4 Replies
neelamsaroha157
Specialist II
Specialist II

Can you elaborate a more on your question...
tjardine99
Contributor
Contributor
Author

A table in MySQL I am trying to extract has the primary key set to field1, field2.  I have these fields in an existing table in QV.  I want to extract the records from the MySQL table with only the values that are in the existing table already loaded.   ex. code: 

SQL

Select *

where field1, field2 in qv_tbl:field1, qv_tbl:field2;

NZFei
Partner - Specialist
Partner - Specialist

load

*

where exists(QVField1, SQLField1) and exists(QVField2, SQLField2);

SQL select

*

From YourSQLDB;

 

tjardine99
Contributor
Contributor
Author

Thanks that worked.   I ended up using the where exists on a QVD (which I load overnite) after pulling the table from MySQL.