sql - How to use SELECT inside COUNT in MYSQL -


i have view:

myview: (id,percent)

i want make view, wich this:

lastview: (lastid, lastpr, counter)

and in "counter", in evrey line want have how money id`s have bigger percent percent of line. tried:

create view lastview(lastid, lastpr, counter) select id lastid, percent lastpr count (select id myview percent < lastpr) counter, myview; 

your there. try this:

select id lastid, percent lastpr, (select count(id)  myview bigger  bigger.percent > myv.percent) counter myview myv  

Comments

Popular posts from this blog

javascript - three.js lot of meshes optimization -

smartface.io - Proper way to change color scheme for whole application -

Email notification in google apps script -