learn java
The moose likes JDBC and Relational Databases 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


Win a copy of The Software Craftsman this week in the Agile forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
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: 62298
    
  68

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:
 
Have you tried LearnNowOnline? http://www.learnnowonline.com/
 
subject: Problem doing inner select with MySql