begin
for i in (select b.bookid,
b.title,
p.publishername as publisher,
a.firstname || ' ' || a.lastname as author
from books b
inner join publisher p on b.publisherid = p.publisherid
inner join author a on b.author_id = a.authorid) loop
dbms_output.put_line(i.bookid || ' ... ' || i.title || ' ... ' || i.publisher || ' ... ' || i.author);
end loop;
end;
1条答案
按热度按时间jjjwad0x1#
绝对不需要三个循环,只需连接数据并循环一次