The USER has the following fields : ID, FIRST_NAME, LAST_NAME.FIRST_NAME , NAST_NAME
have te same basic type and length.
You want to compare fields FIRST_NAME, LAST_NAME to each other.
which of the following SELECT statements can you use?
A. SELECT * FROM users INTO TABLE it_users
WHERE first name = users >> last_name.
B. SELECT * FROM users AS a INTO TABLE it_users
WHERE a >> first_name = a >> last_name
C. SELECT * FROM users INTO TABLE it_users
WHERE first_name = users last_name
답이 왜 AB인지 모르겠습니다..ㅠ
A. SELECT * FROM users INTO TABLE it_users
WHERE first name = users >> last_name.
-> 테이블 users가 from 구문에 1개만 쓰였기 때문에,
where 조건에서 테이블 이름을 줘도 되고 안줘도 됩니다.
즉, 다음 구문들이 다 됩니다.
SELECT * FROM users INTO TABLE it_users
WHERE first name = last_name.
SELECT * FROM users INTO TABLE it_users
WHERE users~first name = users~last_name.
SELECT * FROM users INTO TABLE it_users
WHERE users~first name = last_name.
SELECT * FROM users INTO TABLE it_users
WHERE first name = users~last_name.
B. SELECT * FROM users AS a INTO TABLE it_users
WHERE a >> first_name = a >> last_name
from 구문의 테이블 다음에 AS 구문으로 alias(별명)을 a로 주었기 때문에
A경우와 동일하게 아래 4개 구문이 모두 가능합니다. - 즉, users 테이블은 a 라는 이름으로 사용한 것입니다.
SELECT * FROM users AS a INTO TABLE it_users
WHERE a~first_name = a~last_name
SELECT * FROM users AS a INTO TABLE it_users
WHERE first_name = last_name
SELECT * FROM users AS a INTO TABLE it_users
WHERE a~first_name = last_name
SELECT * FROM users AS a INTO TABLE it_users
WHERE first_name = a~last_name