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 |
eeyc
Starting Member
2 Posts |
Posted - 2009-09-16 : 05:43:18
|
HiiI Have Facing with Order problemi try to query From Tableit go like this ->SELECT * FROM ClientWHERE (ClientName LIKE 'X%') OR (ClientName LIKE '%[ ]X%') it mean give me all clients that start Whit X Letter And Included MiddleName If There is And Last Name.Name,MiddleName And LastName are At same Cell (ClientName) i have qury it and sorting itfirst by Name after it by MiddleName and finlly by LastNamei don't know how to order it.Someon Have an idea how to start ? eyal.c |
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2009-09-16 : 05:58:09
|
Can you give some sample data?The start is to split the column in 3 values.We need samples to see which combination of data can occur in ClientName. No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
eeyc
Starting Member
2 Posts |
Posted - 2009-09-16 : 07:25:08
|
thank's for your posting mei can't split the datato Name can be have number of names name middlename lastname nikename etc (like the arbs names)for example -> ClientName Erorn Mikel Bon Joi Jack clint cary Erorn Mikel Bon Jacov mohamd abo jaml habdalhaa jaber mahmoud ben sabernow query all j names !result need to look like this1. Jack clint cary2. jaber mahmoud ben saber3. mohamd abo jaml habdalhaa4. Erorn Mikel Bon Jacov5. Erorn Mikel Bon Joi eyal.c |
 |
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2009-09-16 : 07:50:39
|
select * from table where ' '+ClientName like '% j%' No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
|
|