I have this view:
myVIEW: (id,percent)
I want to make another view, which will be like this:
LASTVIEW: (lastID, lastPR, counter)
and in "counter", in every line I want to have how money id`s have a bigger percent than the percent of this line. so I tried:
CREATE VIEW LASTVIEW(lastID, lastPR, counter) AS
SELECT id AS lastID, percent AS lastPR
COUNT (SELECT id FROM myVIEW WHERE percent < lastPR) AS counter,
FROM myVIEW;
FROM. Read this