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


Sales puzzle


Sales puzzle

Author
Message
chgn01
chgn01
SSCrazy
SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)

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

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

Group: General Forum Members
Points: 4786 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
SSCrazy Eights
SSCrazy Eights (8.4K reputation)SSCrazy Eights (8.4K reputation)SSCrazy Eights (8.4K reputation)SSCrazy Eights (8.4K reputation)SSCrazy Eights (8.4K reputation)SSCrazy Eights (8.4K reputation)SSCrazy Eights (8.4K reputation)SSCrazy Eights (8.4K reputation)

Group: General Forum Members
Points: 8387 Visits: 2777
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
SSCrazy
SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)

Group: General Forum Members
Points: 2888 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
One Orange Chip
One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)

Group: General Forum Members
Points: 27473 Visits: 7549
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
SSCertifiable
SSCertifiable (6K reputation)SSCertifiable (6K reputation)SSCertifiable (6K reputation)SSCertifiable (6K reputation)SSCertifiable (6K reputation)SSCertifiable (6K reputation)SSCertifiable (6K reputation)SSCertifiable (6K reputation)

Group: General Forum Members
Points: 5979 Visits: 1119
Thanx 4 the easy question :-)
kaspencer
kaspencer
SSCrazy
SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)

Group: General Forum Members
Points: 2941 Visits: 877
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
SSCertifiable
SSCertifiable (6K reputation)SSCertifiable (6K reputation)SSCertifiable (6K reputation)SSCertifiable (6K reputation)SSCertifiable (6K reputation)SSCertifiable (6K reputation)SSCertifiable (6K reputation)SSCertifiable (6K reputation)

Group: General Forum Members
Points: 5979 Visits: 1119
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
SSCertifiable
SSCertifiable (6K reputation)SSCertifiable (6K reputation)SSCertifiable (6K reputation)SSCertifiable (6K reputation)SSCertifiable (6K reputation)SSCertifiable (6K reputation)SSCertifiable (6K reputation)SSCertifiable (6K reputation)

Group: General Forum Members
Points: 5979 Visits: 1119
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
SSCommitted
SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)

Group: General Forum Members
Points: 1662 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