aspose file tools*
The moose likes JDBC and the fly likes Problem doing inner select with MySql Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Problem doing inner select with MySql" Watch "Problem doing inner select with MySql" New topic
Author

Problem doing inner select with MySql

bob morkos
Ranch Hand

Joined: Oct 06, 2003
Posts: 56
I have the following code, can somoene tell me what I did wrong? Thanks in advance.
Select ProfitLoss, Name, DatePosition
FROM interestprofit
Where Security = '13508754'
And TraderName = 'CAN'
GROUP BY TraderName, Security
Having DatePosition IN (Select DatePosition FROM interestprofit WHERE DatePosition = MAX(DatePosition))
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61434
    
  67

can somoene tell me what I did wrong?

Yes, you didn't tell us what the problem was.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Jason Steele
Ranch Hand

Joined: Apr 25, 2003
Posts: 100
Haven't tried it but shouldn't it be:


An egg is a chicken's house!
bob morkos
Ranch Hand

Joined: Oct 06, 2003
Posts: 56
Yes, that would do it. Thanks
Originally posted by Jason Steele:
Haven't tried it but shouldn't it be:
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem doing inner select with MySql