If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Sybase > query help

Reply
 
LinkBack Thread Tools Display Modes
  #31 (permalink)  
Old 08-16-10, 23:10
mycrylinda mycrylinda is offline
Registered User
 
Join Date: Aug 2010
Posts: 1
Quote:
Originally Posted by mike_bike_kite View Post
that's actually the latest date for all employees.
SELECT max(date_time) FROM emp_monthly_sales group by emp_id.

I think the answer is the following.

SELECT a.emp_id, max(b.date_time), b.sales_amount
FROM emp_monthly_sales a, emp_monthly_sales b
WHERE a.emp_id=b.emp_id
GROUP BY a.emp_id

I'm not sure.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On