TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
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.
Reply
Answers (
2
)
upcoming biethday query in SQL
setting up sql server 2008's report builder 2.0