Hey guys,
I am trying to write a simple query that will retrieve new employees that started receiving payments. The indicator in the table is that the new employee will have a payment date of 05-01-2010.
However if I write this query:
It will return everyone because past employees also received payments on this date. I need to find some way to tell the query to only retrieve employees were '2010-05-01' is their first payment record in the table. I don't want to see people who have payment dates occuring before this date.
Can anyone help?
I am trying to write a simple query that will retrieve new employees that started receiving payments. The indicator in the table is that the new employee will have a payment date of 05-01-2010.
However if I write this query:
Code:
select * from dsnp.pr01_t_anty_pymt
where payment_dt = '2010-05-01'
It will return everyone because past employees also received payments on this date. I need to find some way to tell the query to only retrieve employees were '2010-05-01' is their first payment record in the table. I don't want to see people who have payment dates occuring before this date.
Can anyone help?