Using the from method to find the latest products under each column, why are the results incorrect?
P粉441358353
P粉441358353 2022-08-09 13:50:58
0
2
648

Use the from method to find the latest products under each column. Why are the results incorrect?

select goods_id,cat_id,goods_name from (select * from goods where 1 order by cat_id asc,goods_id desc )as tep group by cat_id;

P粉441358353
P粉441358353

reply all (1)
雪漫雨悠

Grouping-》Sort-》Get the latest

  • reply Hello, I would like to ask why what I wrote is the same as what the teacher said, but the from clause in the middle does not work. The latest goods_id obtained is still the first value of each column before sorting.
    P粉441358353 author 2022-08-09 20:38:05
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!