sql - Limit on GROUP BY in Postgresql -


i need have query group tracks created date(month) , limit every group max 10 results.

i'm trying in way:

select  "tracks".*  (select row_number() on (order tracks.votes_count desc) r,       t.*       tracks t       1=1 ) x x.r <= 10 

but give me error on clause:

error: missing from-clause entry table "tracks"

where i'm doing wrong ? how should correct query ?

x alias exposed. need change tracks alias x.

select  x.*  (select row_number() on (order tracks.votes_count desc) r,     t.*     tracks t     1=1 ) x x.r <= 10 

Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -