Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Reverse Wildcard Searches Impossible?
David Best (davebest_at_usa.net) writes:
> Works fine for me on Oracle:
>
> C:\>sqlplus
> Connected to Oracle9i Enterprise Edition Release 9.2.0.1.0
>
> SQL> create table blacklist (pattern varchar2(255));
>
> Table created
>
> SQL> insert into blacklist (pattern) values ('%foobar.com');
>
> 1 row inserted
>
> SQL> select * from blacklist where 'mars2.foobar.com' like pattern;
And the same example (save the funny varchar2) works on MS SQL Server too.
And should work on about any DBMS, as this is core SQL.
-- Erland Sommarskog, SQL Server MVP, sommar_at_algonet.se Books Online for SQL Server SP3 at http://www.microsoft.com/sql/techinfo/productdoc/2000/books.aspReceived on Fri Apr 30 2004 - 17:19:49 CDT