1Z0-051 QUETION 15 别名的用法
2014-05-10 00:09
543 查看
QUESTION 15
View the Exhibit and examine the data in the CUSTOMERS table.
Evaluate the following query:
SQL> SELECT cust_name AS "NAME", cust_credit_limit/2 AS MIDPOINT,MIDPOINT+100 AS "MAX
LOWER LIMIT"
FROM customers;
The above query produces an error on execution.
What is the reason for the error?
A. An alias cannot be used in an expression.
B. The a lias NAME should not be enclosed with in double quotation marks .
C. The MIDPOINT+100 expression gives an error because CUST_CREDIT_LIMIT contains NULL values.
D. The a lias MIDPOINT should be enclosed with in double quotation marks for the
CUST_CREDIT_LIMIT/2 expression .
答案:A
解析:
别名不能在SELECT语句中直接使用。
SQL> SELECT cust_name AS "NAME", cust_credit_limit/2 AS MIDPOINT,MIDPOINT+100 A
S "MAX
2 LOWER LIMIT"
3 FROM customers;
SELECT cust_name AS "NAME", cust_credit_limit/2 AS MIDPOINT,MIDPOINT+100 AS "MA
X
*
ERROR at line 1:
ORA-00904: "MIDPOINT": invalid identifier
View the Exhibit and examine the data in the CUSTOMERS table.
Evaluate the following query:
SQL> SELECT cust_name AS "NAME", cust_credit_limit/2 AS MIDPOINT,MIDPOINT+100 AS "MAX
LOWER LIMIT"
FROM customers;
The above query produces an error on execution.
What is the reason for the error?
A. An alias cannot be used in an expression.
B. The a lias NAME should not be enclosed with in double quotation marks .
C. The MIDPOINT+100 expression gives an error because CUST_CREDIT_LIMIT contains NULL values.
D. The a lias MIDPOINT should be enclosed with in double quotation marks for the
CUST_CREDIT_LIMIT/2 expression .
答案:A
解析:
别名不能在SELECT语句中直接使用。
SQL> SELECT cust_name AS "NAME", cust_credit_limit/2 AS MIDPOINT,MIDPOINT+100 A
S "MAX
2 LOWER LIMIT"
3 FROM customers;
SELECT cust_name AS "NAME", cust_credit_limit/2 AS MIDPOINT,MIDPOINT+100 AS "MA
X
*
ERROR at line 1:
ORA-00904: "MIDPOINT": invalid identifier
相关文章推荐
- OCP-1Z0-051 第12题 别名的用法
- OCP-1Z0-051 第15题 别名的用法
- 1Z0-051 QUESTION 7 ON和USING的用法
- OCP-1Z0-051 第102题 TO_DATE,TO_CHAR,TO_NUMBER函数的用法
- 1Z0-051 QUESTION 8 子查询和JION的用法
- OCP-1Z0-051 第98题 COALESCE函数的用法
- OCP-1Z0-051 第122题 NATURAL JOIN(自然连接)和USING子句的用法
- OCP-1Z0-051 第132题 LEFT OUTER JOIN,RIGHT OUTER JOIN,FULL OUTER JOIN的用法
- OCP-1Z0-051 补充题库 第38题 nvl用法
- OCP-1Z0-051 补充题库 第16题 rownum的用法
- OCP-1Z0-051 第97题 NULLIF,NVL函数用法
- OCP-1Z0-051 第133题 子查询的用法
- OCP-1Z0-051 第6题 case when和decode的用法
- OCP-1Z0-051 第103题 CASE.. WHEN,TO_CHAR,TRIM的用法
- OCP-1Z0-051 第127题 LEFT JOIN,RIGHT JOIN,FULL JOIN外连接的用法
- OCP-1Z0-051 补充题库 第23题 表连接中别名的使用
- OCP-1Z0-051 第7题 ON和USING子句的用法与区别
- 1Z0-051 QUESTION 9 关于INTERSECT的用法
- 1Z0-051 QUESTION 35 Primary key和foreign key的用法
- OCP-1Z0-051 第134题 子查询的用法