求助PL/SQL查询数据排序问题···
发布网友
发布时间:2022-04-10 05:56
我来回答
共2个回答
热心网友
时间:2022-04-10 07:26
create table a
(id int,name varchar(20))
go
create table b
( bid int,nr varchar(20))
go
insert into a select 1,'哈哈' Union all
select 2,'呵呵' Union all
select 3,'喵'
insert into b select 2,'q' Union all
select 2,'w' Union all
select 2,'e' Union all
select 1,'r' Union all
select 1,'u'
select id,name,isnull((select COUNT(1) from b where bid=a.id),0) from a order by 3 desc
热心网友
时间:2022-04-10 08:44
order by 排序字段