SQL Joining query using Selection Statement

前端 未结 2 809
谎友^
谎友^ 2021-01-24 05:50

I have one table of oc_category_description where columns are :

  • category_id
  • name

and other table oc_category where columns are :

2条回答
  •  情歌与酒
    2021-01-24 06:16

    Try this

    select t1.category_id,t1.image, t1.parent_id, t2.name from oc_category as t1 left join oc_category_discription as t2 on t1.category_id = t2.category_id where t1. parent_id = 0 order by id t1.category_id asc;
    

提交回复
热议问题