Skip to content

Instantly share code, notes, and snippets.

@boy3vil
Last active December 19, 2015 01:39
Show Gist options
  • Save boy3vil/5877204 to your computer and use it in GitHub Desktop.
Save boy3vil/5877204 to your computer and use it in GitHub Desktop.
create table table_name (col1, col2)
select col1 from (
select
@rownum:=@rownum+1 number_list, p.*
from table_name p, (SELECT @rownum:=0) r
order by col1
) as new_col
where number_list = 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment