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: Thursday, February 6, 2014 4:15 AM
Points: 1,242, Visits: 1,546
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




Thanks
Vinay Kumar
-----------------------------------------------------------------
Keep Learning - Keep Growing !!!
www.GrowWithSql.com

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, September 25, 2013 8:54 PM
Points: 606, Visits: 151
Good Exercise for Basic of SQL.

Nice One

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


Say Hey Kid

Say Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey Kid

Group: General Forum Members
Last Login: Monday, November 11, 2013 2:35 PM
Points: 673, Visits: 123
Easy question.

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


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Today @ 1:10 PM
Points: 1,942, Visits: 2,381
Thanks Danny


_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
Post #1380672
« Prev Topic | Next Topic »

Add to briefcase «««1234

Permissions Expand / Collapse