Search code examples
sqlms-accesswhere-clausesql-like

How To Use The Where & Like Operator Together in SQL?


I want to display a List of Instructors with only first name and last name, from Georgia and whose last name ends in ‘son’.

I have written this so far:

SELECT firstname, lastname, state
FROM instructors
WHERE state = 'ga'
AND lastname LIKE '%son'

But it is not returning the information requested just a blank table.

Any help would be greatly appreciated


Solution

  • FINALLY !!!!!

    I Figured It Out!

    SELECT firstname, lastname, state
    FROM instructors
    WHERE state = 'ga'
    AND lastname LIKE '*son*'
    

    Instead of using the %WildCard I inserted *WildCard on both ends and it displayed exactly what I was requesting !

    Thanks Everyone For Your Help!