dhS dhS - 4 months ago 23
SQL Question

Similar To function in sql

I am working on the query

(Select d_name from Direction where d_name SIMILAR TO '(WEST|NORTH)%' )
this gives me the result as
WEST 1
WEST 2
NORTH 2
WEST
NORTH


But I want the result as

WEST
NORTH


with the same statement Similar To. Someone please modify the same query to get the 2nd result.
Thanks

dhS dhS
Answer

I got the solution

Select d_name 
from Direction 
where d_name  SIMILAR TO '(WEST|NORTH)' 

Just remove % from the query.