Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't determine MySQL LIKE syntax?

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Ok, this is how it looks with MSSQL, a very straight forward ANSI92 compatible LIKE with wildcards:

WHERE ((strzugriff LIKE '[1,2]%') OR (strzugriff LIKE '____________[1,2]%'))

I've tried everything in MySQL and just can't get the result. Why I have to ask for help beats me, but here it is - can anyone give me a LIKE or REGEXP that works?

WHERE ((strzugriff REGEXP '[1-2]*') OR (strzugriff REGEXP '............[1-2]*'))

...fails miserably?
 
WHERE strzugriff LIKE '%[1,2]%' cuts the need for OR and will return anything remotely like the reuired. ______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top