question

Bob G avatar image
Bob G asked

Wildcard Failure

The following query works...

Select * from [Sometable] where color Like 'Yello%'

(Returns all records with colrs = Yellow)

This query does not work and I need to be able to use single character wildcard.

Select * from [Sometable] where color Like 'Yello_'

(Returns null)

Any Idea why the underscore is not returning any records

Any help is GREATLY appreciated!

sql-server-2005like
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Peso avatar image
Peso answered
Select * from [Sometable] where rtrim(color) Like 'Yello_'            
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Madhivanan avatar image
Madhivanan answered

Not sure if this is what OP needs

Select * from [Sometable] where color Like 'Yello[a-z]'

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.