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
Post a Comment