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

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -