﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Article Discussions / Article Discussions by Author / Discuss content posted by jrtupa  / SELECT (Transact-SQL) / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Wed, 22 May 2013 14:50:19 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: SELECT (Transact-SQL)</title><link>http://www.sqlservercentral.com/Forums/Topic1377356-1202-1.aspx</link><description>Thanks Danny :-)</description><pubDate>Sat, 03 Nov 2012 01:36:15 GMT</pubDate><dc:creator>kapil_kk</dc:creator></item><item><title>RE: SELECT (Transact-SQL)</title><link>http://www.sqlservercentral.com/Forums/Topic1377356-1202-1.aspx</link><description>Easy question.It shows once again, the more options/possibilities, the more errors can be made.</description><pubDate>Mon, 29 Oct 2012 14:50:42 GMT</pubDate><dc:creator>@Cassie</dc:creator></item><item><title>RE: SELECT (Transact-SQL)</title><link>http://www.sqlservercentral.com/Forums/Topic1377356-1202-1.aspx</link><description>Good Exercise for Basic of SQL.Nice OneThanks:-)</description><pubDate>Mon, 29 Oct 2012 14:15:06 GMT</pubDate><dc:creator>asifkareem</dc:creator></item><item><title>RE: SELECT (Transact-SQL)</title><link>http://www.sqlservercentral.com/Forums/Topic1377356-1202-1.aspx</link><description>[quote][b]kapil_kk (10/25/2012)[/b][hr]One question, I am confused on this...select ID, name name from personselect ID ID, name name from personBoth these statements dont give any error message and run successfully...wht is it so?[/quote]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 funselect '--------------------' as TTselect 233 as '____________'            ThanksVinay</description><pubDate>Mon, 29 Oct 2012 06:39:43 GMT</pubDate><dc:creator>Danny Ocean</dc:creator></item><item><title>RE: SELECT (Transact-SQL)</title><link>http://www.sqlservercentral.com/Forums/Topic1377356-1202-1.aspx</link><description>opps, i have selected wrong answer in hurry.</description><pubDate>Mon, 29 Oct 2012 06:33:46 GMT</pubDate><dc:creator>Danny Ocean</dc:creator></item><item><title>RE: SELECT (Transact-SQL)</title><link>http://www.sqlservercentral.com/Forums/Topic1377356-1202-1.aspx</link><description>Easy one... Thanks!</description><pubDate>Sat, 27 Oct 2012 12:44:15 GMT</pubDate><dc:creator>Revenant</dc:creator></item><item><title>RE: SELECT (Transact-SQL)</title><link>http://www.sqlservercentral.com/Forums/Topic1377356-1202-1.aspx</link><description>nice and easy question to check the basics</description><pubDate>Fri, 26 Oct 2012 11:57:33 GMT</pubDate><dc:creator>swarn_soft</dc:creator></item><item><title>RE: SELECT (Transact-SQL)</title><link>http://www.sqlservercentral.com/Forums/Topic1377356-1202-1.aspx</link><description>After I pulled the pencil from my eye and reformatted the question...easy to spot. :w00t:</description><pubDate>Fri, 26 Oct 2012 11:55:11 GMT</pubDate><dc:creator>Meow Now</dc:creator></item><item><title>RE: SELECT (Transact-SQL)</title><link>http://www.sqlservercentral.com/Forums/Topic1377356-1202-1.aspx</link><description>nice easy one for a Friday. Thanks!</description><pubDate>Fri, 26 Oct 2012 11:13:30 GMT</pubDate><dc:creator>KWymore</dc:creator></item><item><title>RE: SELECT (Transact-SQL)</title><link>http://www.sqlservercentral.com/Forums/Topic1377356-1202-1.aspx</link><description>D'oh!  Hit the wrong option...</description><pubDate>Fri, 26 Oct 2012 09:51:46 GMT</pubDate><dc:creator>dawargo</dc:creator></item><item><title>RE: SELECT (Transact-SQL)</title><link>http://www.sqlservercentral.com/Forums/Topic1377356-1202-1.aspx</link><description>If Microsoft ever decide to replace the T-SQL parser with a human, they won't choose me.</description><pubDate>Fri, 26 Oct 2012 07:40:37 GMT</pubDate><dc:creator>Paul White</dc:creator></item><item><title>RE: SELECT (Transact-SQL)</title><link>http://www.sqlservercentral.com/Forums/Topic1377356-1202-1.aspx</link><description>An easy, back to basics question.</description><pubDate>Fri, 26 Oct 2012 07:24:32 GMT</pubDate><dc:creator>Lynn Pettis</dc:creator></item><item><title>RE: SELECT (Transact-SQL)</title><link>http://www.sqlservercentral.com/Forums/Topic1377356-1202-1.aspx</link><description>Thanks, I needed an easy Friday question... the coffee machines are out of order today.</description><pubDate>Fri, 26 Oct 2012 07:03:55 GMT</pubDate><dc:creator>mtassin</dc:creator></item><item><title>RE: SELECT (Transact-SQL)</title><link>http://www.sqlservercentral.com/Forums/Topic1377356-1202-1.aspx</link><description>I learned something new today. I've always used the "=" or "AS" when doing column aliases. So when I looked through the choices on this question, "select Id, name name from Person" seemed like the obvious answer, but fortunately I still looked at the remaining choices, and the last one, while easy to overlook if you skimmed the questions would not work as the column source is always on the right side of the equals.I've been so used to using the AS or "=" I never thought you could omit them. :-)</description><pubDate>Fri, 26 Oct 2012 06:23:12 GMT</pubDate><dc:creator>Dan Graveen</dc:creator></item><item><title>RE: SELECT (Transact-SQL)</title><link>http://www.sqlservercentral.com/Forums/Topic1377356-1202-1.aspx</link><description>Thanks. I needed an easy one for Friday.  Confused me for a second with having 5 possible answers and showing only 4 examples but was awake enough to get it right.</description><pubDate>Fri, 26 Oct 2012 05:59:14 GMT</pubDate><dc:creator>(Bob Brown)  </dc:creator></item><item><title>RE: SELECT (Transact-SQL)</title><link>http://www.sqlservercentral.com/Forums/Topic1377356-1202-1.aspx</link><description>Thanks for the question. A basic but clear one. Just right for a Friday. More?</description><pubDate>Fri, 26 Oct 2012 05:21:59 GMT</pubDate><dc:creator>Thomas Abraham</dc:creator></item><item><title>RE: SELECT (Transact-SQL)</title><link>http://www.sqlservercentral.com/Forums/Topic1377356-1202-1.aspx</link><description>[quote][b]Lokesh Vij (10/25/2012)[/b][hr][quote][b]demonfox (10/25/2012)[/b][hr]I found the glitch ..nice question...thanks[/quote]A trick to catch the glitch.1) Use SSMS, go to "Query" and select "IntelliSense Enabled"2) Copy paste the code3) the syntax error in the query (with error) will be highlighted with zig-zag red line :-)Check the attached image.[img]http://www.sqlservercentral.com/Forums/Attachment12639.aspx[/img][/quote][b]Thanks to all![/b]Ps: don´t "copy paste the code", ok ?;-)</description><pubDate>Fri, 26 Oct 2012 04:11:46 GMT</pubDate><dc:creator>JoseACJr</dc:creator></item><item><title>RE: SELECT (Transact-SQL)</title><link>http://www.sqlservercentral.com/Forums/Topic1377356-1202-1.aspx</link><description>Nice, simple, back-to-basics question, thanks</description><pubDate>Fri, 26 Oct 2012 02:39:43 GMT</pubDate><dc:creator>Stewart "Arturius" Campbell</dc:creator></item><item><title>RE: SELECT (Transact-SQL)</title><link>http://www.sqlservercentral.com/Forums/Topic1377356-1202-1.aspx</link><description>An easy basic question! Thanks!</description><pubDate>Fri, 26 Oct 2012 01:59:34 GMT</pubDate><dc:creator>palotaiarpad</dc:creator></item><item><title>RE: SELECT (Transact-SQL)</title><link>http://www.sqlservercentral.com/Forums/Topic1377356-1202-1.aspx</link><description>[quote][b]demonfox (10/25/2012)[/b][hr]I found the glitch ..nice question...thanks[/quote]A trick to catch the glitch.1) Use SSMS, go to "Query" and select "IntelliSense Enabled"2) Copy paste the code3) the syntax error in the query (with error) will be highlighted with zig-zag red line :-)Check the attached image.[img]http://www.sqlservercentral.com/Forums/Attachment12639.aspx[/img]</description><pubDate>Thu, 25 Oct 2012 23:46:42 GMT</pubDate><dc:creator>Lokesh Vij</dc:creator></item><item><title>RE: SELECT (Transact-SQL)</title><link>http://www.sqlservercentral.com/Forums/Topic1377356-1202-1.aspx</link><description>Thanks Koen and Lokesh :)</description><pubDate>Thu, 25 Oct 2012 23:41:45 GMT</pubDate><dc:creator>kapil_kk</dc:creator></item><item><title>RE: SELECT (Transact-SQL)</title><link>http://www.sqlservercentral.com/Forums/Topic1377356-1202-1.aspx</link><description>[quote][b]kapil_kk (10/25/2012)[/b][hr]One question, I am confused on this...select ID, name name from personselect ID ID, name name from personBoth these statements dont give any error message and run successfully...wht is it so?[/quote]'coz they are syntactically correct. They follow the belew rule[code="plain"]SELECT &amp;lt;column_name&amp;gt; [optional "AS" keyword] [optional &amp;lt;alias_name&amp;gt;]FROM   &amp;lt;table_name&amp;gt;[/code]Alias_name can be same as that of column_name. Hope it is clear now</description><pubDate>Thu, 25 Oct 2012 23:33:09 GMT</pubDate><dc:creator>Lokesh Vij</dc:creator></item><item><title>RE: SELECT (Transact-SQL)</title><link>http://www.sqlservercentral.com/Forums/Topic1377356-1202-1.aspx</link><description>[quote][b]kapil_kk (10/25/2012)[/b][hr]One question, I am confused on this...select ID, name name from personselect ID ID, name name from personBoth these statements dont give any error message and run successfully...wht is it so?[/quote]Think both statements as the following:[code="sql"]select ID, name [AS] name from person;select ID [AS] ID, name [AS] name from person[/code]The AS keyword is optional when used for aliases in the SELECT statement.</description><pubDate>Thu, 25 Oct 2012 23:28:55 GMT</pubDate><dc:creator>Koen Verbeeck</dc:creator></item><item><title>RE: SELECT (Transact-SQL)</title><link>http://www.sqlservercentral.com/Forums/Topic1377356-1202-1.aspx</link><description>An easy one to close the week, thanks!</description><pubDate>Thu, 25 Oct 2012 23:27:32 GMT</pubDate><dc:creator>Koen Verbeeck</dc:creator></item><item><title>RE: SELECT (Transact-SQL)</title><link>http://www.sqlservercentral.com/Forums/Topic1377356-1202-1.aspx</link><description>I found the glitch ..nice question...thanks</description><pubDate>Thu, 25 Oct 2012 23:15:06 GMT</pubDate><dc:creator>demonfox</dc:creator></item><item><title>RE: SELECT (Transact-SQL)</title><link>http://www.sqlservercentral.com/Forums/Topic1377356-1202-1.aspx</link><description>One question, I am confused on this...select ID, name name from personselect ID ID, name name from personBoth these statements dont give any error message and run successfully...wht is it so?</description><pubDate>Thu, 25 Oct 2012 23:14:31 GMT</pubDate><dc:creator>kapil_kk</dc:creator></item><item><title>RE: SELECT (Transact-SQL)</title><link>http://www.sqlservercentral.com/Forums/Topic1377356-1202-1.aspx</link><description>Easy question.Thanks</description><pubDate>Thu, 25 Oct 2012 22:31:02 GMT</pubDate><dc:creator>malleswarareddy_m</dc:creator></item><item><title>RE: SELECT (Transact-SQL)</title><link>http://www.sqlservercentral.com/Forums/Topic1377356-1202-1.aspx</link><description>An easy one for Friday :-)Apparantly, I noticed that there were 4 select statements in the question and 5 select statements as the answer choice :-D</description><pubDate>Thu, 25 Oct 2012 21:58:15 GMT</pubDate><dc:creator>Lokesh Vij</dc:creator></item><item><title>RE: SELECT (Transact-SQL)</title><link>http://www.sqlservercentral.com/Forums/Topic1377356-1202-1.aspx</link><description>Easy question..thanks:)</description><pubDate>Thu, 25 Oct 2012 21:25:58 GMT</pubDate><dc:creator>kalyani.k478</dc:creator></item><item><title>RE: SELECT (Transact-SQL)</title><link>http://www.sqlservercentral.com/Forums/Topic1377356-1202-1.aspx</link><description>Thanks for the question.</description><pubDate>Thu, 25 Oct 2012 21:16:05 GMT</pubDate><dc:creator>SQLRNNR</dc:creator></item><item><title>RE: SELECT (Transact-SQL)</title><link>http://www.sqlservercentral.com/Forums/Topic1377356-1202-1.aspx</link><description>Nice clean question.But maybe a little too easy.  If one assumes that T-SQL has the sort of consistent syntax that most programming languages have, then only the second and fourth options are possible answers (since if either of the otherw was wrong then so would at leat one more be wrong, and the radio buttons allow for only one); so the only question is whether the "as" keyword can be omitted or whether "a as b" and "b as a" mean the same thing - but letting those mean the same thing would mean one couldn't cope with renaming a column with another solumn's name, whic would be rather odd, so the principle of minimising oddity (which in my experience applies to all languages except C++) tells us the answer straight away.</description><pubDate>Thu, 25 Oct 2012 21:04:45 GMT</pubDate><dc:creator>L' Eomot Inversé</dc:creator></item><item><title>RE: SELECT (Transact-SQL)</title><link>http://www.sqlservercentral.com/Forums/Topic1377356-1202-1.aspx</link><description>It was necessary to practice the basics to get where he is today!</description><pubDate>Thu, 25 Oct 2012 20:53:51 GMT</pubDate><dc:creator>JoseACJr</dc:creator></item><item><title>RE: SELECT (Transact-SQL)</title><link>http://www.sqlservercentral.com/Forums/Topic1377356-1202-1.aspx</link><description>Here we go back to the basics once again ....</description><pubDate>Thu, 25 Oct 2012 20:23:24 GMT</pubDate><dc:creator>bitbucket-25253</dc:creator></item><item><title>SELECT (Transact-SQL)</title><link>http://www.sqlservercentral.com/Forums/Topic1377356-1202-1.aspx</link><description>Comments posted to this topic are about the item [B]&lt;A HREF="/questions/T-SQL/93797/"&gt;SELECT (Transact-SQL)&lt;/A&gt;[/B]</description><pubDate>Thu, 25 Oct 2012 20:22:48 GMT</pubDate><dc:creator>JoseACJr</dc:creator></item></channel></rss>