Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Reverse Wildcard Searches Impossible?

Re: Reverse Wildcard Searches Impossible?

From: Erland Sommarskog <sommar_at_algonet.se>
Date: Fri, 30 Apr 2004 22:19:49 +0000 (UTC)
Message-ID: <Xns94DC31A1B00CYazorman@127.0.0.1>


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.asp
Received on Fri Apr 30 2004 - 17:19:49 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US