Click here to Skip to main content
15,912,329 members
Home / Discussions / Database
   

Database

 
QuestionSQL Query - join or exists? Pin
Dewald27-Nov-06 3:26
Dewald27-Nov-06 3:26 
AnswerRe: SQL Query - join or exists? Pin
ednrgc27-Nov-06 3:33
ednrgc27-Nov-06 3:33 
GeneralRe: SQL Query - join or exists? Pin
Dewald27-Nov-06 4:05
Dewald27-Nov-06 4:05 
GeneralRe: SQL Query - join or exists? Pin
ednrgc27-Nov-06 4:08
ednrgc27-Nov-06 4:08 
GeneralRe: SQL Query - join or exists? Pin
Dewald27-Nov-06 4:21
Dewald27-Nov-06 4:21 
GeneralRe: SQL Query - join or exists? Pin
ednrgc27-Nov-06 9:15
ednrgc27-Nov-06 9:15 
AnswerRe: SQL Query - join or exists? Pin
Pete O'Hanlon27-Nov-06 9:16
mvePete O'Hanlon27-Nov-06 9:16 
AnswerRe: SQL Query - join or exists? Pin
Michael Potter27-Nov-06 10:16
Michael Potter27-Nov-06 10:16 
The only tricky part is getting the OrderDescr field into your result. There are a few ways to accomplish this and I have one listed below (TSQL) that should work. Life would be easier if you had a primary key on the order table.

SELECT 
    *
FROM
    Orders o1
INNER JOIN
    (SELECT 
        custID,
        MIN(OrderDate)
     FROM 
        Orders 
     GROUP BY
	custId) o2
    ON (o1.CustId = o2.CustId AND
        o1.OrderDate = o2.OrderDate)

QuestionSQL help needed Pin
jegastar27-Nov-06 2:06
jegastar27-Nov-06 2:06 
AnswerRe: SQL help needed Pin
Pete O'Hanlon27-Nov-06 2:15
mvePete O'Hanlon27-Nov-06 2:15 
AnswerRe: SQL help needed Pin
jegastar27-Nov-06 2:28
jegastar27-Nov-06 2:28 
GeneralRe: SQL help needed Pin
jegastar27-Nov-06 2:30
jegastar27-Nov-06 2:30 
GeneralRe: SQL help needed Pin
Rob Graham27-Nov-06 2:55
Rob Graham27-Nov-06 2:55 
Question"trigger" Pin
ravikiranreddydharmannagari26-Nov-06 20:16
ravikiranreddydharmannagari26-Nov-06 20:16 
AnswerRe: "trigger" Pin
Pete O'Hanlon27-Nov-06 1:41
mvePete O'Hanlon27-Nov-06 1:41 
AnswerRe: "trigger" Pin
Eric Dahlvang27-Nov-06 3:23
Eric Dahlvang27-Nov-06 3:23 
QuestionConnecting Problem [modified] Pin
firebow300726-Nov-06 19:40
firebow300726-Nov-06 19:40 
AnswerRe: Connecting Problem Pin
Paul Conrad25-Dec-06 18:22
professionalPaul Conrad25-Dec-06 18:22 
QuestionConnection pool and open & close ...??? Pin
devboycpp25-Nov-06 19:07
devboycpp25-Nov-06 19:07 
AnswerRe: Connection pool and open & close ...??? Pin
nguyenvhn26-Nov-06 15:12
nguyenvhn26-Nov-06 15:12 
QuestionOracle [modified] Pin
Chira Chandra25-Nov-06 16:03
Chira Chandra25-Nov-06 16:03 
Questionhow to do normalization in sql database Pin
Rmesh25-Nov-06 5:06
Rmesh25-Nov-06 5:06 
AnswerRe: how to do normalization in sql database Pin
User 171649225-Nov-06 5:26
professionalUser 171649225-Nov-06 5:26 
AnswerHOMEWORK Pin
leckey25-Nov-06 15:49
leckey25-Nov-06 15:49 
QuestionComparing values in a table Pin
DAAKH25-Nov-06 2:57
DAAKH25-Nov-06 2:57 

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.