select BOOK_ID,NAME,'无' LEND_MAN,'未借出' LEND_TIME from tb_book where STATUS='A'; UNION select A.BOOK_ID,A.NAME,B.LEND_MAN,B.LEND_TIME from tb_book a,tb_lend_book b where a.book_id=b.book_id;
你这个是不是ORACLE的,报错: ’无效 SQL 语句‘
select a.book_id,a.name,b.lend_man,b.lend_time from tb_book a,tb_lend_book b where a.book_id = b.book_id (+)
哦,应该是这样 select a.book_id,a.name,nvl(b.lend_man,无),nvl(b.lend_time,没借出) from tb_book a,tb_lend_book b where a.book_id = b.book_id (+)
TO: tsyd(天生一对) 当然是啊!按 flyingdae(dae) 的方法也可以的,主要就这两种方法。 我刚才多写了一个分号。select BOOK_ID,NAME,'无' LEND_MAN,'未借出' LEND_TIME from tb_book where STATUS='A' UNION select A.BOOK_ID,A.NAME,B.LEND_MAN,B.LEND_TIME from tb_book a,tb_lend_book b where a.book_id=b.book_id;
from tb_book where STATUS='A';
UNION
select A.BOOK_ID,A.NAME,B.LEND_MAN,B.LEND_TIME
from tb_book a,tb_lend_book b
where a.book_id=b.book_id;
select a.book_id,a.name,nvl(b.lend_man,无),nvl(b.lend_time,没借出) from tb_book a,tb_lend_book b where a.book_id = b.book_id (+)
当然是啊!按 flyingdae(dae) 的方法也可以的,主要就这两种方法。
我刚才多写了一个分号。select BOOK_ID,NAME,'无' LEND_MAN,'未借出' LEND_TIME
from tb_book where STATUS='A'
UNION
select A.BOOK_ID,A.NAME,B.LEND_MAN,B.LEND_TIME
from tb_book a,tb_lend_book b
where a.book_id=b.book_id;