+ 1
Can LIKE IN be used in sql in same query?
Guys will this work??? SELECT * FROM fname, city WHERE city LIKE IN (‘%c’, ‘%l’, ‘%l’, ‘t%) ORDER BY fname ASC; Will this work? Someone test it..
3 Answers
+ 3
Are you sure LIKE IN exists?
I can't find it anywhere
+ 2
Yes, Toni Isotalo was right, there is no condition specified that way, LIKE and IN each defines their own specification, I never see them mixed up to define a condition so far, however, it is *perhaps* possible to use them both in a single query given each defines their own condition e.g.
SELECT * FROM cities WHERE city_name LIKE '%io' AND province IN ('AB','CD','EF');
This I guess works : )
Hth, cmiiw
0
Yeah. I was just into the lesson when I had this question. Since with IN, one can scroll through multiple values (without using OR) and by LIKE, one can check the (t%). (Two birds with one stone, so I thought). May be isnt possible. Confused though.