View Single Post

   
  #2 (permalink)  
Old 02-28-2008, 08:18 AM
Stefan Rybacki
 
Posts: n/a
Default Re: Reverse like query?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Rune schrieb:
> I have some problems figuring this one out. How do I put together a query
> that selects those rows in which a field contains a substring of another
> given string.
>
> e.g.
>
> table test (test varchar(255))
>
> row1: this is a test
> row2: test
> row3: a test
> row4: that
>
> If I have a string called "a test", then I want to select row 1 + 3, but not
> 2 and 4.
>
> thanks
> /Rune
>
>


SELECT * FROM table WHERE test LIKE '%a test%'

Regards
Stefan
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (MingW32)

iD8DBQFD2hQGyeCLzp/JKjARAgcKAJ9bnreVPkAexS77/7/HhmgKQc0oqgCdGvCS
Gy/hlNFk38SepsZgCSxPtaU=
=V8jz
-----END PGP SIGNATURE-----
Reply With Quote