SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Sales puzzle


Sales puzzle

Author
Message
chgn01
chgn01
SSCommitted
SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)

Group: General Forum Members
Points: 1921 Visits: 1874
Comments posted to this topic are about the item Sales puzzle

--------------------------------------
;-)“Everything has beauty, but not everyone sees it.” ― Confucius
Lokesh Vij
Lokesh Vij
SSCrazy
SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)

Group: General Forum Members
Points: 2800 Visits: 1599
Ah! Very simple question to start the day. Thanks Gary:-)

~ Lokesh Vij

Guidelines for quicker answers on T-SQL question
Guidelines for answers on Performance questions

Link to my Blog Post --> www.SQLPathy.com

Follow me @Twitter


kapil_kk
kapil_kk
SSCarpal Tunnel
SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)

Group: General Forum Members
Points: 4178 Visits: 2766
Lokesh Vij (8/13/2013)
Ah! Very simple question to start the day. Thanks Gary:-)

+1 :-)

_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
Danny Ocean
Danny Ocean
SSCommitted
SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)

Group: General Forum Members
Points: 1992 Visits: 1549
kapil_kk (8/13/2013)
Lokesh Vij (8/13/2013)
Ah! Very simple question to start the day. Thanks Gary:-)

+1 :-)


+1:-)

Thanks
Vinay Kumar
-----------------------------------------------------------------
Keep Learning - Keep Growing !!!
www.GrowWithSql.com
Stewart "Arturius" Campbell
Stewart "Arturius" Campbell
SSChampion
SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)

Group: General Forum Members
Points: 13221 Visits: 7381
Nice, Simple question, thanks

____________________________________________
Space, the final frontier? not any more...
All limits henceforth are self-imposed.
“libera tute vulgaris ex”
Hany Helmy
Hany Helmy
Hall of Fame
Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)

Group: General Forum Members
Points: 3931 Visits: 1117
Thanx 4 the easy question :-)
kaspencer
kaspencer
SSCrazy
SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)

Group: General Forum Members
Points: 2594 Visits: 849
I have worked with SQL Server on and off for many years, but I don't think I recall ever seeing "ORDER BY [number]" as it appears in this question.
Could some kindly person explain this to me, because a clear explanation seems to be difficult to locate in the documentation, and in searches. This little issue was why I failed this question!

Many thanks

Kenneth Spencer

You never know: reading my book: "All about your computer" might just tell you something you never knew!
lulu.com/kaspencer
Hany Helmy
Hany Helmy
Hall of Fame
Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)

Group: General Forum Members
Points: 3931 Visits: 1117
kaspencer (8/14/2013)
I have worked with SQL Server on and off for many years, but I don't think I recall ever seeing "ORDER BY [number]" as it appears in this question.
Could some kindly person explain this to me, because a clear explanation seems to be difficult to locate in the documentation, and in searches. This little issue was why I failed this question!

Many thanks

Kenneth Spencer


Order by [some number], this number indicates the order of the column in the Select clause.

Hope that would help you.
Hany Helmy
Hany Helmy
Hall of Fame
Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)

Group: General Forum Members
Points: 3931 Visits: 1117
hany.helmy (8/14/2013)
kaspencer (8/14/2013)
I have worked with SQL Server on and off for many years, but I don't think I recall ever seeing "ORDER BY [number]" as it appears in this question.
Could some kindly person explain this to me, because a clear explanation seems to be difficult to locate in the documentation, and in searches. This little issue was why I failed this question!

Many thanks

Kenneth Spencer

Order by [some number], this number indicates the order of the column in the Select clause.

Hope that would help you.


Like for example:

Select EmpId, EmpName, DeptId, DeptName
From SomeTable
Order by 2 -- this indicates that the result set will be sorted by column no. 2 in the Select clause which is 'EmpName'.



Regards,
Hany Helmy
Dineshbabu
Dineshbabu
Ten Centuries
Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)

Group: General Forum Members
Points: 1368 Visits: 569
kaspencer (8/14/2013)
I have worked with SQL Server on and off for many years, but I don't think I recall ever seeing "ORDER BY [number]" as it appears in this question.
Could some kindly person explain this to me, because a clear explanation seems to be difficult to locate in the documentation, and in searches. This little issue was why I failed this question!

Many thanks

Kenneth Spencer


Hi kenneth,

In Order By we can specify integer representing the position of the column in the select list. The result set will be sorted based on the column. For further details pls refer

http://technet.microsoft.com/en-us/library/ms188385.aspx

Also FYI, Order By has no effect in this question, without sorting also you will get the same result, Its matter of Where clause.
I hope you are aware of Where clause will be applied before Order By.

--
Dineshbabu
Desire to learn new things..
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search