Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
i load data from a database. Now i want to load only data where the field product = *sprite* or product = "cola" is.
What is the correct syntax for it?
FROM `databasename`.`tablename` where product = '*sprite*' or where product = '*cola*'
regards,
Fritz
You need to know which wildcards and quotes your database supported (look there in the help or ask google). Also it might be helpful to change the equal-sign with like:
where product like '*cola*' or product like '*sprite*'
- Marcus
Hi,
You only need the where once :
FROM `databasename`.`tablename` where product = '*sprite*' or product = '*cola*';
where product = '*sprite*' or product = '*cola*';
Hi, the "= '*cola*'" maybe tries to find that exact string.
If doesn't works try with:
where product like '%sprite%' or product like '%cola%';
I try it like this, but now qlik sense loads no data. There is no error.
Is SQL SELECT a problem?
LOAD ID,
product,
price;
SQL SELECT ID,
product,
price
FROM `databasename`.`tablename` where product = '*cola*' or product = '*sprite*';
I try it also with %cola%.
regards,
Fritz
You need to know which wildcards and quotes your database supported (look there in the help or ask google). Also it might be helpful to change the equal-sign with like:
where product like '*cola*' or product like '*sprite*'
- Marcus
Thank you Marcus and the others for help!
With like and % it works. I use a MySQL Database.
regards,
Fritz