I have a Person table with LastName and FirstName.
Consider the following record where
FirstName == ‘Pete’ and LastName == ‘Aaaa’
When I run the following select statements:
select * from Person where FirstName='Pete' and LastName like 'a%' -- 0 record returned
select * from Person where FirstName='Pete' and LastName like 'aa%' -- 1 record returned
select * from Person where FirstName='Pete' and LastName like 'aaa%' -- 0 record returned
select * from Person where FirstName='Pete' and LastName like 'aaaa%' -- 1 record returned
When I run this in SQL Fiddle – 1 record is returned for every select as it should SQL Fiddle query
Anybody have any ideas?
try this