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 |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2006-01-10 : 07:56:49
|
| Jennifer writes "This is probably really easy but not sure how to handle. I'm running SQL server version 7.0 on a Windows 2000 machine I have a simple Select statement where I'm selecting Name,Link, and Category from the TrainingData table and joining TrainingCateoryRelate and TrainingCategory tables Where TCR.[Category ID] = 4 and TD.[InActive] = 0 ORDER BY TD.[Name]. A page of mine on the Intranet uses this select statement to give links to certain documents on a server.Sample file names the select statement brings up are......Advanced Inside SalesAdvanced Inside Sales Commitment FormEDGE EPEC Agreement FormEPEC ExpertsEPEC Manager Trainee AgreementEPEC Train The TrainerEPEC Training Policybut I need to order the links so that EPEC Training Policy comes first then EPEC Agreement Form EPEC Manager Trainee Agreement EPEC Experts and EPEC Train the Trainer. Please Help!" |
|
|
Srinika
Master Smack Fu Yak Hacker
1378 Posts |
Posted - 2006-01-10 : 12:03:47
|
| Not clear about ur requirement, but check the following:Select * from(Select .... from ur_tables .... join .... ) as Q1Where FirstField like 'EPEC%'Union Select * from(Select .... from ur_tables .... join .... ) as Q2Where FirstField not like 'EPEC%' |
 |
|
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2006-01-10 : 14:44:38
|
Select column list...from Mytableorder by case when name like 'EPEC%' then 0 else 1 end, name CODO ERGO SUM |
 |
|
|
|
|
|