tuanbs

tuanbs

  • NA
  • 23
  • 103.9k

How to combine 2 conditions in search LIKE

May 1 2010 3:46 AM

Search LIKE is correct in 2 following cases:
   1. select Orders.ShipName from Orders where Orders.ShipName LIKE 'a%'
   2. select Orders.ShipName from Orders where Orders.ShipName LIKE '_a%'
Note: (_) is blank.
But now I want to search LIKE use both 2 conditions above with records of condition 1 come first, then records of condition 2 come next. I try:  
select Orders.ShipName from Orders where Orders.ShipName like 'a%' OR Orders.ShipName LIKE '%_a%' 
But records mixed up each other between 2 conditions. Please give me a solution. Thanks a lot.

Answers (2)