Click here to Skip to main content
15,916,601 members
Home / Discussions / Database
   

Database

 
GeneralRe: converting nvarchar to smalldatetime Pin
Richard MacCutchan19-Oct-09 4:47
mveRichard MacCutchan19-Oct-09 4:47 
AnswerRe: converting nvarchar to smalldatetime Pin
Mycroft Holmes19-Oct-09 14:31
professionalMycroft Holmes19-Oct-09 14:31 
Questionserver down Pin
baala.m18-Oct-09 17:24
baala.m18-Oct-09 17:24 
AnswerRe: server down Pin
Mycroft Holmes18-Oct-09 19:31
professionalMycroft Holmes18-Oct-09 19:31 
AnswerRe: server down Pin
scottgp19-Oct-09 3:06
professionalscottgp19-Oct-09 3:06 
QuestionOrder of evaluation for sub-queries Pin
Steve Holdorf18-Oct-09 9:52
Steve Holdorf18-Oct-09 9:52 
AnswerRe: Order of evaluation for sub-queries Pin
Not Active18-Oct-09 10:45
mentorNot Active18-Oct-09 10:45 
AnswerRe: Order of evaluation for sub-queries Pin
i.j.russell18-Oct-09 11:27
i.j.russell18-Oct-09 11:27 
Is this what you were trying to do?
SELECT o1.OrderID, o1.CustomerID, o1.EmployeeID, o1.OrderDate, o1.RequiredDate
FROM Orders AS o1
WHERE o1.OrderDate = (SELECT MAX(o2.OrderDate)
		      FROM Orders AS o2
	       	      WHERE o2.EmployeeID = o1.EmployeeID) 
AND o1.RequiredDate = (SELECT MAX(o3.RequiredDate)
                       FROM Orders AS o3
                       WHERE o3.EmployeeID = o1.EmployeeID
                            AND o3.OrderDate = o1.OrderDate)
AND o1.OrderId = (SELECT MAX(o4.OrderID) 
                  FROM Orders AS o4
                  WHERE o4.EmployeeID = o1.EmployeeID
                  AND o4.OrderDate = o1.OrderDate)

I find it much easier to read if I indent the code and explicitly use table alias'. The intent of the sql becomes much clearer.
GeneralRe: Order of evaluation for sub-queries Pin
Steve Holdorf18-Oct-09 13:03
Steve Holdorf18-Oct-09 13:03 
GeneralRe: Order of evaluation for sub-queries Pin
Mycroft Holmes18-Oct-09 15:00
professionalMycroft Holmes18-Oct-09 15:00 
GeneralRe: Order of evaluation for sub-queries Pin
i.j.russell18-Oct-09 22:31
i.j.russell18-Oct-09 22:31 
QuestionUnderstanding what an inner join query produces Pin
Steve Holdorf17-Oct-09 19:02
Steve Holdorf17-Oct-09 19:02 
AnswerRe: Understanding what an inner join query produces Pin
Mycroft Holmes17-Oct-09 20:50
professionalMycroft Holmes17-Oct-09 20:50 
AnswerRe: Understanding what an inner join query produces Pin
Eddy Vluggen18-Oct-09 0:52
professionalEddy Vluggen18-Oct-09 0:52 
GeneralRe: Understanding what an inner join query produces Pin
Mycroft Holmes18-Oct-09 1:00
professionalMycroft Holmes18-Oct-09 1:00 
GeneralRe: Understanding what an inner join query produces Pin
Eddy Vluggen18-Oct-09 2:23
professionalEddy Vluggen18-Oct-09 2:23 
AnswerRe: Understanding what an inner join query produces Pin
Not Active18-Oct-09 3:34
mentorNot Active18-Oct-09 3:34 
QuestionDatabase Synchronization Pin
Member 426726116-Oct-09 19:32
Member 426726116-Oct-09 19:32 
AnswerRe: Database Synchronization Pin
εїзεїзεїз16-Oct-09 20:05
εїзεїзεїз16-Oct-09 20:05 
AnswerRe: Database Synchronization Pin
Mycroft Holmes16-Oct-09 23:02
professionalMycroft Holmes16-Oct-09 23:02 
QuestionFind lowest common ancestor in a in a tree using the Adjacency list model Pin
Jörgen Andersson16-Oct-09 4:28
professionalJörgen Andersson16-Oct-09 4:28 
AnswerRe: Find lowest common ancestor in a in a tree using the Adjacency list model Pin
Mycroft Holmes16-Oct-09 23:07
professionalMycroft Holmes16-Oct-09 23:07 
GeneralRe: Find lowest common ancestor in a in a tree using the Adjacency list model Pin
Jörgen Andersson17-Oct-09 11:44
professionalJörgen Andersson17-Oct-09 11:44 
GeneralRe: Find lowest common ancestor in a in a tree using the Adjacency list model Pin
Mycroft Holmes17-Oct-09 13:25
professionalMycroft Holmes17-Oct-09 13:25 
QuestionUpdate top row Pin
dptalt16-Oct-09 3:49
dptalt16-Oct-09 3:49 

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.