It's a great way to set up user-defined filters and figure out what
strings trigger user filters.  Great for event notification based on
keywords.


Dov Katz
Enterprise & Client Technology
Morgan Stanley
750 7th Avenue | 34th Floor | NYC 10019
+1 (212) 762-2171
[EMAIL PROTECTED]

  _____  

From: Adrian Lynch [mailto:[EMAIL PROTECTED]
Sent: Friday, August 20, 2004 8:14 AM
To: CF-Talk
Subject: RE: SQL Reverse "LIKE" query

Surprisingly that worked! Got no idea why you'd want to do it but!

Ade

-----Original Message-----
From: Katz, Dov B (IT) [mailto:[EMAIL PROTECTED]
Sent: 20 August 2004 13:02
To: CF-Talk
Subject: SOT: SQL Reverse "LIKE" query

Has anyone ever written (for MSSQL2K) a reverse "LIKE" query, where I
pass in a String literal, and all rows whose value the string contains
are returned.

Traditional LIKE query
select * from MyTable where MyColumn LIKE '%STR%'

The Reverse LIKE query
select * from MyTable where 'STR' LIKE ('%' + MyColumn + '%')

Would this work? I can't try it until this weekend...

Presumably, for a LIKE query, a non-indexed varchar(20) "MyColumn" value
comparison results in an entire table scan no matter what , so it
shouldn't be forcing any fundamental time to the query

Do you know though if there is anything I should be worried about?

Thanks in advance
dbk

Dov Katz
Enterprise & Client Technology
Morgan Stanley
750 7th Avenue | 34th Floor | NYC 10019
<mailto:[EMAIL PROTECTED]>
--------------------------------------------------------

NOTICE: If received in error, please destroy and notify sender.  Sender
does
not waive confidentiality or privilege, and use is prohibited.
  _____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to