select id,s.sid, (select total_aver_score from car_comment_score where sid = tb2.sid) as '×ÜÆÀ·Ö', supports,series from ( select id,sid,supports,row_number() over (partition by sid order by id desc) as row_id2 from car_comment as comm ) as tb2 inner join car_series as s on tb2.sid = s.sid where row_id2 = 1 and MinPrice >=0 and MaxPrice <= 550000 order by id desc
»¹ÊÇû¿´µ½ÎÒÒªµÄ½á¹û¡£¡£¡£ SQL code: select id,s.sid, (select total_aver_score from car_comment_score where sid = tb2.sid) as '×ÜÆÀ·Ö', supports,series,count(1)over(partition by series) as ×ܸöÊý from ( select id,sid,supports,row_number() over (partition by sid order by id desc) as row_id2 from car_comment as comm ) as tb2
ͨ¹ýNAME×Ö¶ÎÌõ¼þ²éѯһ¸öÊý¾Ý±í£¬¼ÙÉèÎÒÓÐ100¸öÐÕÃû£¬ÓÐÒÔÏÂÁ½¸ö·½·¨£¬ ·½·¨1£º °Ñ100¸öName ×é³ÉÒ»¸öSQLÓï¾ä£¬±ÈÈç Select * from tmp_table where Name='ÕÅÈý' or Name ='ÀîËÄ' Or ...Or Name='µÚÒ»°Ù¸öÐÕÃû' ......