
July 25th, 2012, 02:39 AM
|
|
Registered User
|
|
Join Date: Jun 2012
Posts: 17
Time spent in forums: 3 h 48 m 31 sec
Reputation Power: 0
|
|
|
Thanks - have added in this code
select slstop.account, slstop.sys_date, slstop.stop_flag
from (
select slstop.account,
slstop.sys_date,
slstop.stop_flag,
row_number() over (partition by slstop.account order by slstop.sys_date desc) as rn
from slstop
) t
where rn = 1
order by slstop.account
But get this error?
ERROR: missing FROM-clause entry for table "slstop"
LINE 1: select slstop.account, slstop.sys_date, slstop.stop_flag
Tried adding this
select slstop.account, slstop.sys_date, slstop.stop_flag
from slstop(
select slstop.account,
slstop.sys_date,
slstop.stop_flag,
row_number() over (partition by slstop.account order by slstop.sys_date desc) as rn
from slstop
) t
where rn = 1
order by slstop.account
But get this error? Where am i going wrong?
ERROR: syntax error at or near "select"
LINE 3: select slstop.account,
|