|
楼主

楼主 |
发表于 2006-6-12 17:10:35
|
只看该作者
关于声明变量属于哪个数据集的问题
<!-- m --><a class="postlink" href="http://www.mysas.net/tF7k3Uc0/59267/m70/m70_61.htm">http://www.mysas.net/tF7k3Uc0/59267/m70/m70_61.htm</a><!-- m -->
第五题:
You are writing a PROC SQL query that will display the names of all library cardholders who work as volunteers for the library, and the number of books that each volunteer currently has checked out. You will use one or both of the following tables:
Library.Circulation lists the name and contact information for all library cardholders, and the number of books that each cardholder currently has checked out.
Library.Volunteers lists the name and contact information for all library volunteers.
Assume that the values of Name are unique in both tables.
Which of the following PROC SQL queries will produce your report?
The correct answer is below:
proc sql;
select name, checkedout
from library.circulation
where name in
(select name
from library.volunteers);
为什么在where语句中的name没有声明是属于哪个数据集的?这样不会混淆么?
/*where circulation.name in
(select volunteers.name
from library.volunteers); */
是不是因为name的使用在各自的select语句中是明确属于哪个数据集的时候就不用声明了。
谢谢大家。 |
|