Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- WITH t as (SELECT CONCAT(cust_first_name, cust_last_name) name,
- cust_city city, cust_street_address address,
- CUST_MAIN_PHONE_NUMBER number_,
- cust_email email,
- LENGTH(CUST_STREET_ADDRESS) ln
- FROM SH.CUSTOMERS WHERE CUST_MAIN_PHONE_NUMBER LIKE '%77'
- ORDER BY ln DESC),
- max_number as (SELECT ln FROM t WHERE ROWNUM = 1)
- SELECT name, city, address, number_ FROM t WHERE ln = (SELECT * FROM max_number);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement