Click here to Skip to main content
15,887,175 members
Home / Discussions / Database
   

Database

 
QuestionSelect first entries in a table matching given criteria Pin
Dewald26-May-13 10:12
Dewald26-May-13 10:12 
AnswerRe: Select first entries in a table matching given criteria Pin
Mycroft Holmes26-May-13 12:47
professionalMycroft Holmes26-May-13 12:47 
GeneralRe: Select first entries in a table matching given criteria Pin
Dewald26-May-13 22:10
Dewald26-May-13 22:10 
GeneralRe: Select first entries in a table matching given criteria Pin
Mycroft Holmes26-May-13 22:35
professionalMycroft Holmes26-May-13 22:35 
GeneralRe: Select first entries in a table matching given criteria Pin
Dewald26-May-13 22:56
Dewald26-May-13 22:56 
GeneralRe: Select first entries in a table matching given criteria Pin
Mycroft Holmes26-May-13 23:04
professionalMycroft Holmes26-May-13 23:04 
GeneralRe: Select first entries in a table matching given criteria Pin
Jörgen Andersson27-May-13 0:32
professionalJörgen Andersson27-May-13 0:32 
GeneralRe: Select first entries in a table matching given criteria Pin
Dewald27-May-13 0:54
Dewald27-May-13 0:54 
Jörgen Andersson wrote:
I believe one subquery is unnecessary. Try:
SQL
SELECT  *
FROM    Orders
WHERE   OrderID IN (
    SELECT  TOP 1 OrderID
    FROM    Orders O1
    GROUP BY CustomerID
    ORDER BY Inserted
)

I'm not sure I understand that inner query. For one OrderID in the SELECT clause should surely be part of an aggregate function seeing as it is not in the GROUP BY clause. Also, for Inserted to be contained in the ORDER BY clause it will also have to be part of an aggregate function. What am I missing?
GeneralRe: Select first entries in a table matching given criteria Pin
Jörgen Andersson27-May-13 11:12
professionalJörgen Andersson27-May-13 11:12 
QuestionWindows accounts for SSE Pin
Richard.Berry10025-May-13 22:35
Richard.Berry10025-May-13 22:35 
QuestionVA Database Pin
Daaron24-May-13 4:10
Daaron24-May-13 4:10 
QuestionRe: VA Database Pin
Eddy Vluggen24-May-13 4:18
professionalEddy Vluggen24-May-13 4:18 
AnswerRe: VA Database Pin
jschell24-May-13 12:40
jschell24-May-13 12:40 
AnswerRe: VA Database Pin
Richard MacCutchan24-May-13 4:19
mveRichard MacCutchan24-May-13 4:19 
AnswerRe: VA Database Pin
R. Giskard Reventlov24-May-13 5:15
R. Giskard Reventlov24-May-13 5:15 
GeneralRe: VA Database Pin
PIEBALDconsult24-May-13 11:45
mvePIEBALDconsult24-May-13 11:45 
AnswerRe: VA Database Pin
jschell24-May-13 12:43
jschell24-May-13 12:43 
QuestionCreate Mysql Music Database Help Pin
Muveen_Delhi23-May-13 22:28
Muveen_Delhi23-May-13 22:28 
AnswerRe: Create Mysql Music Database Help Pin
Eddy Vluggen24-May-13 3:02
professionalEddy Vluggen24-May-13 3:02 
GeneralRe: Create Mysql Music Database Help Pin
Muveen_Delhi24-May-13 18:08
Muveen_Delhi24-May-13 18:08 
GeneralRe: Create Mysql Music Database Help Pin
Mycroft Holmes26-May-13 12:51
professionalMycroft Holmes26-May-13 12:51 
QuestionINSERT - SELECT QUERY Help Needed. Pin
codingrocks23-May-13 9:00
codingrocks23-May-13 9:00 
AnswerRe: INSERT - SELECT QUERY Help Needed. Pin
Mycroft Holmes23-May-13 11:15
professionalMycroft Holmes23-May-13 11:15 
QuestionHey need help of adding data T__T Pin
Al Arcilla23-May-13 4:54
Al Arcilla23-May-13 4:54 
AnswerRe: Hey need help of adding data T__T Pin
Simon_Whale23-May-13 5:16
Simon_Whale23-May-13 5:16 

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.