mySQL Returning the top 5 of each category

前端 未结 2 2009
余生分开走
余生分开走 2020-11-27 17:07

I want to be able to return 5 menuitem per menu. I\'ve tried this several script but had no luck. here are the tables

menus
-------
menuid int()
profileName          


        
2条回答
  •  悲哀的现实
    2020-11-27 18:00

    SELECT TOP 5 m.profilename, s.name
    FROM menus m INNER JOIN menuitems s ON m.menuID = s.menuid
    

提交回复
热议问题