SQL Query | Level – Basic 2

Question

Get all employee detail from EmployeeDetail table whose
“FirstName” not start with any single character between ‘a-p’

in progress 0
Ritika Sohal 4 years 2 Answers 1021 views Member 0

Answers ( 2 )

  1. ^ operator denotes NOT . In below query ^a-p means any character other than a,b,c,d……till p of alphabet. So start of the FirstName will be from q/r/s/t/u/v/…../z.

    SELECT * FROM EmployeeDetail WHERE FirstName like ‘[^a-p]%’

  2. Select *from EmployeeDetail where FirstName REGEXP ‘^[^a-p]%’

Leave an answer

Browse
Browse