Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
peanutong
Starting Member
3 Posts |
Posted - 2008-08-24 : 23:04:19
|
| 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"? |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2008-08-24 : 23:09:55
|
[code]select *from yourtablewhere data like 'user1%'[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
peanutong
Starting Member
3 Posts |
Posted - 2008-08-24 : 23:14:45
|
| thank you for your prompt reply. however for user1, i'll be retrieving it from a control (lblShowUser.Text).can i make itselect * from mytable where msg like '" & lblShowUser.Text & "'% ? will it work? |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2008-08-24 : 23:16:21
|
yes KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-08-25 : 02:56:19
|
| Better use stored procedure with input parametersMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|