Advertisement
Guest User

task 2

a guest
Feb 26th, 2020
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. WITH t as (SELECT CONCAT(cust_first_name, cust_last_name) name,
  2. cust_city city, cust_street_address address,
  3. CUST_MAIN_PHONE_NUMBER number_,
  4. cust_email email,
  5. LENGTH(CUST_STREET_ADDRESS) ln
  6. FROM SH.CUSTOMERS WHERE CUST_MAIN_PHONE_NUMBER LIKE '%77'
  7. ORDER BY ln DESC),
  8. max_number as (SELECT ln FROM t WHERE ROWNUM = 1)
  9.  
  10. SELECT name, city, address, number_ FROM t WHERE ln = (SELECT * FROM max_number);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement