What does adding ranked to a mysql query do?
I'm trying code from this post
SELECT * FROM ( SELECT @row := @row +1 AS rownum, [column name] FROM ( SELECT @row :=0) r, [table name] ) ranked WHERE rownum % [n] = 1
What does adding ranked to a mysql query do?
I'm trying code from this post
SELECT * FROM ( SELECT @row := @row +1 AS rownum, [column name] FROM ( SELECT @row :=0) r, [table name] ) ranked WHERE rownum % [n] = 1
Nothing, apparently, as "ranked" isn't a MySQL keyword that I can find. Did you possibly mean "ordered by"?
"ranked" is an alias that you're giving to your sub-select. You're just omitting the "AS" keyword, which is allowed in MySQL.
Example: SELECT name from MyTable AS table1