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 |
|
kfluffie
Posting Yak Master
103 Posts |
Posted - 2008-06-12 : 04:37:48
|
| Hi,is it possibly to use several conditions from "LIKE"?Example:SELECT col1 FROM table1WHERE col1 LIKE IN -- Or something. This "query" does not work of course.('123%','124%','124%') |
|
|
RickD
Slow But Sure Yak Herding Master
3608 Posts |
Posted - 2008-06-12 : 04:47:06
|
| where (col1 like '123%' or col1 like '%123' or col1 like '1%23') |
 |
|
|
kfluffie
Posting Yak Master
103 Posts |
Posted - 2008-06-12 : 05:22:25
|
quote: Originally posted by RickD where (col1 like '123%' or col1 like '%123' or col1 like '1%23')
Of course!Another question:If I have a column with 2-3 characters and I want to fill out the records with only two charachters two three with a space.How do I proceed with that?Thanks in advance!Best Regards,KF |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-06-12 : 05:37:00
|
Trailing space:UPDATE Table1 SET Col1 = LEFT(Col1 + ' ', 3)Leading space:UPDATE Table1 SET Col1 = RIGHT(' ' + Col1, 3) E 12°55'05.25"N 56°04'39.16" |
 |
|
|
kfluffie
Posting Yak Master
103 Posts |
Posted - 2008-06-12 : 05:58:40
|
quote: Originally posted by Peso Trailing space:UPDATE Table1 SET Col1 = LEFT(Col1 + ' ', 3)Leading space:UPDATE Table1 SET Col1 = RIGHT(' ' + Col1, 3) E 12°55'05.25"N 56°04'39.16"
Thank you Peso! |
 |
|
|
|
|
|