Board index » delphi » Help: InterBase WHERE Field LIKE 'Value%'

Help: InterBase WHERE Field LIKE 'Value%'

Query:

SELECT * FROM Customers
WHERE Name LIKE 'P%y'

On MS SQL Server, this query returns all the customers whose name starts
with the letter P and end's in the letter y ('Parkway Auto Body', 'Pearson
Realty', 'Percy Photography', etc.).

HOWEVER, on InterBase, with the same data, this query returns an empty
result set! In fact the % wildcard character only seems to work if it is at
the end of the string (e.g. WHERE Name LIKE 'P%').

Is this a limitation on InterBase's part? If so, what is the functional
equivalent?

Dave Prothero
Argos Software

 

Re:Help: InterBase WHERE Field LIKE 'Value%'


You must write this SQL command:

select * from Customers where Name Like "P%%y"

Dave Prothero <dpr...@iname.com> escreveu no artigo
<6c00nq$h...@forums.borland.com>...

Quote
> Query:

> SELECT * FROM Customers
> WHERE Name LIKE 'P%y'

> On MS SQL Server, this query returns all the customers whose name starts
> with the letter P and end's in the letter y ('Parkway Auto Body',
'Pearson
> Realty', 'Percy Photography', etc.).

> HOWEVER, on InterBase, with the same data, this query returns an empty
> result set! In fact the % wildcard character only seems to work if it is
at
> the end of the string (e.g. WHERE Name LIKE 'P%').

> Is this a limitation on InterBase's part? If so, what is the functional
> equivalent?

> Dave Prothero
> Argos Software

Other Threads