Page 1 of 1

Where clause using part of a string

Posted: Thu Mar 24, 2016 12:45 pm
by AlessioForconi
Hello,

having this data
abcd efgh hilmne
abcd efgh hilmne
abcd efgh hilmne
abcd efgh hilmno
abcd efgh hilmno
abcd efgh hilmno
abcd efgh hilmna
abcd efgh hilmna
...
...
how can I build a query that extracts all records with hilmne?

Thanks

Re: Where clause using part of a string

Posted: Thu Mar 24, 2016 3:00 pm
by Klaus
Buongiorno Alessio,

is one line one database field in one record in your example data?
Or a "set" of (several) fields in one record?

In any case you will be need to use: LIKE %...
Something like this if one line is one field in your example:
...
SELECT * from YOURTABLE WHERE YOUR_FIELD LIKE '%hilmne%'
...
Check this for more info:
http://www.w3schools.com/sql/default.asp


Best

Klaus

Re: Where clause using part of a string

Posted: Thu Mar 24, 2016 3:51 pm
by AlessioForconi
Guten tag Klaus

you're right, I did not specify that the data on which I intend to run the query are found every line in the same field of the database. I try with% like.

Thank you