Click here to Skip to main content
15,900,511 members
Home / Discussions / Database
   

Database

 
QuestionRe: OVER (PARTITION BY ORDER BY ) Pin
Eddy Vluggen14-Jul-14 7:47
professionalEddy Vluggen14-Jul-14 7:47 
AnswerRe: OVER (PARTITION BY ORDER BY ) Pin
Jörgen Andersson14-Jul-14 8:33
professionalJörgen Andersson14-Jul-14 8:33 
GeneralRe: OVER (PARTITION BY ORDER BY ) Pin
Mycroft Holmes14-Jul-14 12:54
professionalMycroft Holmes14-Jul-14 12:54 
GeneralRe: OVER (PARTITION BY ORDER BY ) Pin
Jörgen Andersson14-Jul-14 22:20
professionalJörgen Andersson14-Jul-14 22:20 
GeneralRe: OVER (PARTITION BY ORDER BY ) Pin
Ambertje14-Jul-14 22:12
Ambertje14-Jul-14 22:12 
AnswerRe: OVER (PARTITION BY ORDER BY ) Pin
jschell14-Jul-14 10:07
jschell14-Jul-14 10:07 
AnswerRe: OVER (PARTITION BY ORDER BY ) Pin
GuyThiebaut14-Jul-14 21:33
professionalGuyThiebaut14-Jul-14 21:33 
GeneralRe: OVER (PARTITION BY ORDER BY ) Pin
Ambertje14-Jul-14 22:13
Ambertje14-Jul-14 22:13 
QuestionError: Can't delete row or update row in SQL Server ? Pin
taibc11-Jul-14 18:29
taibc11-Jul-14 18:29 
AnswerRe: Error: Can't delete row or update row in SQL Server ? Pin
Mycroft Holmes11-Jul-14 23:32
professionalMycroft Holmes11-Jul-14 23:32 
GeneralRe: Error: Can't delete row or update row in SQL Server ? Pin
taibc13-Jul-14 20:36
taibc13-Jul-14 20:36 
GeneralRe: Error: Can't delete row or update row in SQL Server ? Pin
Mycroft Holmes13-Jul-14 21:06
professionalMycroft Holmes13-Jul-14 21:06 
AnswerRe: Error: Can't delete row or update row in SQL Server ? Pin
ZurdoDev14-Jul-14 10:14
professionalZurdoDev14-Jul-14 10:14 
QuestionJOIN vs. WHERE Pin
Klaus-Werner Konrad11-Jul-14 9:22
Klaus-Werner Konrad11-Jul-14 9:22 
AnswerRe: JOIN vs. WHERE Pin
Mycroft Holmes11-Jul-14 14:24
professionalMycroft Holmes11-Jul-14 14:24 
GeneralRe: JOIN vs. WHERE Pin
Klaus-Werner Konrad12-Jul-14 9:08
Klaus-Werner Konrad12-Jul-14 9:08 
GeneralRe: JOIN vs. WHERE Pin
Mycroft Holmes12-Jul-14 14:13
professionalMycroft Holmes12-Jul-14 14:13 
GeneralRe: JOIN vs. WHERE Pin
Klaus-Werner Konrad13-Jul-14 0:08
Klaus-Werner Konrad13-Jul-14 0:08 
AnswerRe: JOIN vs. WHERE Pin
data modeling guy11-Jul-14 19:53
data modeling guy11-Jul-14 19:53 
GeneralRe: JOIN vs. WHERE Pin
Mycroft Holmes11-Jul-14 23:29
professionalMycroft Holmes11-Jul-14 23:29 
GeneralRe: JOIN vs. WHERE Pin
Jörgen Andersson12-Jul-14 9:42
professionalJörgen Andersson12-Jul-14 9:42 
AnswerRe: JOIN vs. WHERE Pin
Jörgen Andersson12-Jul-14 10:25
professionalJörgen Andersson12-Jul-14 10:25 
The downvote you got is stupid because the question is valid.

The problem is though that readability isn't the same as clarity of intention, and there is more to it than you see at the first glance.

Firstly, when using an ANSI Join you specify which TABLES to join.
When using an implicit join you specify which fields to join on.

This is normally not making any difference, but it might in some specific cases.

Consider this query:
SQL
SELECT O.Order_No, C.Address, F.Address
FROM Orders O, Address C, Address F 
WHERE O.Customer = C.ID 
AND O.Forwarder = F.ID(+)
AND F.OtherID = 1
Is it the same as:
SQL
SELECT  O.Order_No, C.Address, F.Address 
FROM    Orders O
JOIN    Address C
    ON  O.Customer = C.ID
LEFT OUTER JOIN Address F 
    ON  O.Forwarder = F.ID
    AND F.OtherID = 1
or:
SQL
SELECT  O.Order_No, C.Address, F.Address 
FROM    Orders O
JOIN    Address C
    ON  O.Customer = C.ID
LEFT OUTER JOIN Address F 
    ON  O.Forwarder = F.ID
WHERE   F.OtherID = 1

The difference is crucial as the results differ.

Secondly, when using an implicit join there is no way to force the optimizer to do the joins in a certain order, which normally is a good thing. The optimizer is usually better than many people on that.
But sometime you know better than the optimizer and can force the joining order as such:
SQL
SELECT  O.Order_No, C.Address, F.Address 
FROM    (
    Orders O JOIN  Address C
    ON  O.Customer = C.ID
    )   JOIN    Address F 
    ON  O.Forwarder = C.ID



My personal pet peeve is that a field should always have the same name everywhere in a database just like the ISO standard says. Smile | :)
Wrong is evil and must be defeated. - Jeff Ello[^]

GeneralRe: JOIN vs. WHERE Pin
Mycroft Holmes12-Jul-14 14:22
professionalMycroft Holmes12-Jul-14 14:22 
GeneralRe: JOIN vs. WHERE Pin
Jörgen Andersson12-Jul-14 20:44
professionalJörgen Andersson12-Jul-14 20:44 
GeneralRe: JOIN vs. WHERE Pin
Jörgen Andersson12-Jul-14 20:55
professionalJörgen Andersson12-Jul-14 20:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.