Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase «««1234

SELECT (Transact-SQL) Expand / Collapse
Author
Message
Posted Monday, October 29, 2012 6:39 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: 2 days ago @ 6:46 AM
Points: 1,074, Visits: 1,130
kapil_kk (10/25/2012)
One question, I am confused on this...

select ID, name name from person

select ID ID, name name from person

Both these statements dont give any error message and run successfully...
wht is it so?


Hi kapil,

1st statement :-
it's showing that you are giving the alias column name to column 2(name). I can also right this like:-
select ID, name as [name] from person
or
select ID, name as [Column_2] from person

2nd Statement :-same thing happen in 2nd statement.

Check below statement. have fun

select '--------------------' as TT
select 233 as '____________'


Thanks
Vinay


Keep Learning - Keep Growing !!!
http://growwithsql.blogspot.in

Thanks
Vinay Kumar
Post #1378222
Posted Monday, October 29, 2012 2:15 PM
SSChasing Mays

SSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing Mays

Group: General Forum Members
Last Login: Wednesday, May 08, 2013 8:34 AM
Points: 606, Visits: 134
Good Exercise for Basic of SQL.

Nice One

Thanks
Post #1378460
Posted Monday, October 29, 2012 2:50 PM


Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Wednesday, April 24, 2013 2:28 PM
Points: 510, Visits: 119
Easy question.

It shows once again, the more options/possibilities, the more errors can be made.
Post #1378476
Posted Saturday, November 03, 2012 1:36 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: 2 days ago @ 7:40 PM
Points: 1,059, Visits: 1,150
Thanks Danny
Post #1380672
« Prev Topic | Next Topic »

Add to briefcase «««1234

Permissions Expand / Collapse