Sql server 同一张表中ID,Name,ParentID要求同时查出ParentID对应的Name
要求:从本表中显示出parentid所对应的typename
select child.typename as parenttypename,parent.typename as typename,parent.parentid from questiontype as parent inner join questiontype as child on parent.parentId=child.ID order by parent.ID desc
效果
...
原创
2021-10-09 21:44:35 ·
535 阅读 ·
0 评论