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.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Sql query please reply

Author  Topic 

rajeshskpm
Starting Member

10 Posts

Posted - 2009-01-30 : 04:52:50
suppose one table named 'emp'.

what will be the opt of below query?

select 1,2 from emp order by 1

[1,2 are not table columns]



rajesh

Nageswar9
Aged Yak Warrior

600 Posts

Posted - 2009-01-30 : 04:56:18
by default it returns 1 and 2 values for table
Go to Top of Page

bklr
Master Smack Fu Yak Hacker

1693 Posts

Posted - 2009-01-30 : 04:56:53
1,2 values
as how many rows in ur table that many rows u will get
Go to Top of Page

Nageswar9
Aged Yak Warrior

600 Posts

Posted - 2009-01-30 : 04:56:54
declare @temp table ( date datetime,price int )
insert into @temp
select '1/1/2009',10 union all
select '3/1/2009',15 union all
select '5/1/2009',20 union all
select '7/1/2009',25

select 1,2 from @temp
Go to Top of Page

bklr
Master Smack Fu Yak Hacker

1693 Posts

Posted - 2009-01-30 : 05:12:44
wt is the use of giving dynamically 1,2 values from tablename
Go to Top of Page

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2009-01-30 : 05:42:01
Laziness.
Go to Top of Page
   

- Advertisement -