76.You need to display the first names of all customers from the CUSTOMERS table that contain the
character 'e' and have the character 'a' in the second last position.
Which query would give the required output?
A.SELECT cust_first_name FROM customers
WHERE INSTR(cust_first_name, 'e')<>0 AND
SUBSTR(cust_first_name, -2, 1)='a';
B.SELECT cust_first_name FROM customers
WHERE INSTR(cust_first_name, 'e')<>'' AND
SUBSTR(cust_first_name, -2, 1)='a';
C.SELECT cust_first_name FROM customers
WHERE INSTR(cust_first_name, 'e')IS NOT NULL AND
SUBSTR(cust_first_name, 1,-2)='a';
D.SELECT cust_first_name FROM customers
WHERE INSTR(cust_first_name, 'e')<>0 AND
SUBSTR(cust_first_name, LENGTH(cust_first_name),-2)='a';
答案:A
解析:题目包含e,并且a在倒数第二个
<>''这个肯定为false,参考59题,排除B,
substr(STR1 => , POS => , LEN => ),第二个是位置,第三个是截取长度,排除C,D
character 'e' and have the character 'a' in the second last position.
Which query would give the required output?
A.SELECT cust_first_name FROM customers
WHERE INSTR(cust_first_name, 'e')<>0 AND
SUBSTR(cust_first_name, -2, 1)='a';
B.SELECT cust_first_name FROM customers
WHERE INSTR(cust_first_name, 'e')<>'' AND
SUBSTR(cust_first_name, -2, 1)='a';
C.SELECT cust_first_name FROM customers
WHERE INSTR(cust_first_name, 'e')IS NOT NULL AND
SUBSTR(cust_first_name, 1,-2)='a';
D.SELECT cust_first_name FROM customers
WHERE INSTR(cust_first_name, 'e')<>0 AND
SUBSTR(cust_first_name, LENGTH(cust_first_name),-2)='a';
答案:A
解析:题目包含e,并且a在倒数第二个
<>''这个肯定为false,参考59题,排除B,
substr(STR1 => , POS => , LEN => ),第二个是位置,第三个是截取长度,排除C,D