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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Like Statement

Status
Not open for further replies.

gkrenton

MIS
Jul 2, 2003
151
0
0
US
I'm back!!!! MSSql syntax for the like statement allows this statement to give me results for all inv_id2 that are
5040,5050,5060 & excludes the others.
But informix sql ignores the bracketed parameter - I can't imagine that I have to make a case statement for each iteration but every SQL resource I own indicate that the brackets should work but it doesn't.


SELECT
Distinct inv_id3,
inv_id3||02,
Case when inv_id2 LIKE "%00%" then "Length" else "fit" END,
Case when inv_id2 like "50[4-6]%" then "Width" else "Size" END
FROM inv Inner Join ecat_item_size2 ON inv_id3=inv_id

Can someone enlighten me as to the hidden syntax?

Thanks
Gina
 
HAve you tried this ?
Case when inv_id2 matches "50[4-6]*"

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
No didn't know matches but that seems to work if one uses the * as a wildcard vs the % wildcard. Thanks - guess I'll look up Matches in the infamous piles of books to figure out when to use it vs 'like'.

- Thank you

Gina
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top