SELECT * FROM (SELECT row_number() OVER (PARTITION BY siteid ORDER BY bookid) as rownum, * FROM novel_bookchapterinfo) t WHERE t.rownum = 1