List the first and last names of all customers whose first names start with the letters 'A', 'J' or 'T' or last names end with the substring 'on'. Arrange them alphabetically in the order of their first names.
Answers
Answered by
10
Answer:
select First_name, Last_name
from customer
where first_name regexp '^[ajt]' or last_name regexp 'on$'
order by first_name;
Explanation:
Answered by
1
Answer:
Sample output
First_name Last_name
MARY SMITH
Explanation:
select First_name, Last_name
from customer
where first_name regexp '^[ajt]' or last_name regexp 'on$'
order by first_name;
Let % here represent 0 or more symbols. Thus, J% represents a name that should begin with J and can have 0 or more symbols after that. Also, %on represents a name that should end with 'on' and can include 0 or more symbols before 'on'.
#SPJ3
Similar questions