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 |
|
malaytech2008
Yak Posting Veteran
95 Posts |
Posted - 2008-11-24 : 01:05:22
|
| Hi,I m facing problem when try to select specific column value from subquery.e.gselect name from (select distinct name, age from emp order by name asc,age asc)thanks in advancemalay |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-11-24 : 01:09:30
|
No meaning specifying it in subquery. you should be ordering only in final selectselect name from (select distinct name, age from emp )t order by t.name asc,t.age asc |
 |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2008-11-24 : 01:40:29
|
| You need to give a name to the derived tableselect name from (select distinct name, age from emp order by name asc,age asc) a==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
malaytech2008
Yak Posting Veteran
95 Posts |
Posted - 2008-11-24 : 07:00:29
|
| Thanks Visakh, it works finemalay |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-11-24 : 07:03:23
|
welcome keep in mind that order cant be guarnteed unless you use explicit order by in final select statement |
 |
|
|
|
|
|