Skip to content

Instantly share code, notes, and snippets.

@magigo
Last active April 6, 2017 12:54
Show Gist options
  • Save magigo/187897cc8ef1f65f54f5 to your computer and use it in GitHub Desktop.
Save magigo/187897cc8ef1f65f54f5 to your computer and use it in GitHub Desktop.
mysql
1、为查询结果自动编号:
select (@rowNO := @rowNo+1) AS rowno, user_name from (select wu.screen_name as user_name from base_wb_ids_pr_hobbies mt left join base_wb_user wu on mt.uid = wu.id where mt.hobby_id = 224424 order by -mt.pagerank limit 1000) a,(select @rowNO :=0) b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment