书名重复时取最小ID.
try->
select id=identity(int,1,1),书号,书名,出版社,价格,出版日期,库存 into # from A,B,C where A.书名=C.书名 and A.出版社=B.出版社
select * from # t where not exists(select 1 from # where 书名=t.书名 and id<t.id)
try->
select id=identity(int,1,1),书号,书名,出版社,价格,出版日期,库存 into # from A,B,C where A.书名=C.书名 and A.出版社=B.出版社
select * from # t where not exists(select 1 from # where 书名=t.书名 and id<t.id)
这个行不
试试吧,应该可以
left join B b ON a.出版社=b.出版社
left join C c ON a.书名=b.书名
left join B b ON a.出版社=b.出版社
left join C c ON a.书名=c.书名