August 24, 2008 at 9:11 pm
how do i select data from a table by sorting the first word from a column?
for example:
"user1 hello"
"user2 one two three"
"user3 where are you"
"user1 im fine"
how can i select all the data starting with "user1"?
August 24, 2008 at 10:17 pm
Lookup LIKE in Books Online - you can use the following:
SELECT [columns]
FROM table
WHERE column LIKE 'user1_%';
Jeffrey Williams
“We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”
― Charles R. Swindoll
How to post questions to get better answers faster
Managing Transaction Logs
August 24, 2008 at 10:39 pm
Jeffery, Shouldn't that be:
SELECT [columns]
FROM table
WHERE column LIKE 'user1 %';
?
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
August 25, 2008 at 3:29 pm
rbarryyoung (8/24/2008)
Jeffery, Shouldn't that be:SELECT [columns]
FROM table
WHERE column LIKE 'user1 %';
?
Yes - you are right.
Jeffrey Williams
“We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”
― Charles R. Swindoll
How to post questions to get better answers faster
Managing Transaction Logs
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply