Click here to Skip to main content
15,891,567 members
Home / Discussions / Database
   

Database

 
AnswerRe: connection string Pin
Giorgi Dalakishvili4-Nov-08 20:05
mentorGiorgi Dalakishvili4-Nov-08 20:05 
GeneralRe: connection string Pin
LiYS4-Nov-08 20:18
LiYS4-Nov-08 20:18 
GeneralRe: connection string Pin
Giorgi Dalakishvili4-Nov-08 20:25
mentorGiorgi Dalakishvili4-Nov-08 20:25 
Questionget difference between two double precision columns Pin
kani984-Nov-08 12:36
kani984-Nov-08 12:36 
AnswerRe: get difference between two double precision columns Pin
Blue_Boy4-Nov-08 14:26
Blue_Boy4-Nov-08 14:26 
GeneralRe: get difference between two double precision columns Pin
kani984-Nov-08 17:52
kani984-Nov-08 17:52 
AnswerRe: get difference between two double precision columns Pin
Wendelius4-Nov-08 18:13
mentorWendelius4-Nov-08 18:13 
Questioncorrelated subselect Pin
Smithers-Jones4-Nov-08 0:30
Smithers-Jones4-Nov-08 0:30 
i am having some trouble with a correlated-subselect-statement (using mysql 5.0):

i have a table that looks simplyfied like this:
myTable:
--------------------------
ColID	NameID  ColDate
--------------------------
1	1	2008-10-01
2	1	2008-07-01
3	2	2008-06-11
4	3	2008-09-12
5	4	2008-03-15
6	2	2008-11-21
7	3	2008-08-19
8	4	2008-01-30
--------------------------

now i need for every nameID to select only the row with the latest date.
desired result:
--------------------------
ColID	NameID  ColDate
--------------------------
1	1	2008-10-01
4	3	2008-09-12
5	4	2008-03-15
6	2	2008-11-21
--------------------------


i tried the following select-statement:
SELECT * FROM myTable AS T1 WHERE ColDate=(SELECT MAX(T2.ColDate) FROM myTable AS T2 WHERE T1.NameID=T2.NameID)

but got the error message: #1064 - You have an error in your SQL syntax.

thanks for any help with this.

"I love deadlines. I like the whooshing sound they make as they fly by." (DNA)

AnswerRe: correlated subselect [modified] Pin
Wendelius4-Nov-08 4:58
mentorWendelius4-Nov-08 4:58 
GeneralRe: correlated subselect Pin
Smithers-Jones4-Nov-08 8:07
Smithers-Jones4-Nov-08 8:07 
GeneralRe: correlated subselect Pin
Wendelius4-Nov-08 8:23
mentorWendelius4-Nov-08 8:23 
AnswerRe: correlated subselect Pin
Blue_Boy4-Nov-08 6:10
Blue_Boy4-Nov-08 6:10 
GeneralRe: correlated subselect Pin
Smithers-Jones4-Nov-08 9:24
Smithers-Jones4-Nov-08 9:24 
AnswerRe: correlated subselect Pin
SomeGuyThatIsMe4-Nov-08 7:28
SomeGuyThatIsMe4-Nov-08 7:28 
GeneralRe: correlated subselect Pin
Smithers-Jones4-Nov-08 8:25
Smithers-Jones4-Nov-08 8:25 
GeneralRe: correlated subselect Pin
SomeGuyThatIsMe4-Nov-08 8:31
SomeGuyThatIsMe4-Nov-08 8:31 
GeneralRe: correlated subselect Pin
Smithers-Jones4-Nov-08 8:52
Smithers-Jones4-Nov-08 8:52 
GeneralRe: correlated subselect Pin
SomeGuyThatIsMe4-Nov-08 9:39
SomeGuyThatIsMe4-Nov-08 9:39 
GeneralRe: correlated subselect Pin
Smithers-Jones5-Nov-08 0:43
Smithers-Jones5-Nov-08 0:43 
JokeRe: correlated subselect Pin
Smithers-Jones5-Nov-08 0:37
Smithers-Jones5-Nov-08 0:37 
GeneralRe: correlated subselect Pin
PIEBALDconsult5-Nov-08 14:39
mvePIEBALDconsult5-Nov-08 14:39 
QuestionOpinion on how to handle a DataSet Pin
stormydaniels4-Nov-08 0:05
stormydaniels4-Nov-08 0:05 
AnswerRe: Opinion on how to handle a DataSet Pin
Wendelius4-Nov-08 4:53
mentorWendelius4-Nov-08 4:53 
QuestionConfigure Auto Database Replication Problem Using Sql Server 2000 Pin
veereshIndia3-Nov-08 18:55
veereshIndia3-Nov-08 18:55 
AnswerRe: Configure Auto Database Replication Problem Using Sql Server 2000 Pin
Wendelius4-Nov-08 5:05
mentorWendelius4-Nov-08 5:05 

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.