Alexander Farber wrote:
And:
pref=> select * from (
select u.id,
u.first_name,
u.city,
m.money,
rank() over (order by money desc)
from pref_users u, pref_money m where
m.yw=to_char(current_timestamp, '-IW')
) ar
where ar.id='OK1382399
And:
pref=> select * from (
select u.id,
u.first_name,
u.city,
m.money,
rank() over (order by money desc)
from pref_users u, pref_money m where
m.yw=to_char(current_timestamp, '-IW')
) ar
where ar.id='OK138239987797';
works, but deliver
Sorry Rob, but it fails with:
pref=> select * from (
select u.id,
u.first_name,
u.city,
m.money,
rank() over (order by money desc)
from pref_users u, pref_money m where
m.yw=to_char(current_timestamp, '-IW')
) all_ranks ar
where ar.id='OK
Alexander Farber wrote:
Hello,
I have 2 tables with user infos (please see \d output at the bottom)
and would like to find their rank depending on their "money".
When I select all records, the rank() works fine:
pref=> select u.first_name,
u.city,
m.money,
rank() over (order by money desc)
fro
Hello,
I have 2 tables with user infos (please see \d output at the bottom)
and would like to find their rank depending on their "money".
When I select all records, the rank() works fine:
pref=> select u.first_name,
u.city,
m.money,
rank() over (order by money desc)
from pref_users u, pref_money