Re: Fast SQL Question

From: Hugo Kornelis <hugo_at_pe_NO_rFact.in_SPAM_fo>
Date: Tue, 29 Nov 2005 23:36:46 +0100
Message-ID: <uplpo1t6gfclam1btef2li6idsamotnvag_at_4ax.com>


On 28 Nov 2005 11:52:10 -0800, Filter911 wrote:

>If I use like and I want to find all emails in hotmail that have at
>least one char before the '_at_' and after the '.'
>Is this the right command
>
>where EmailAddress like '%__at_hotmail._%'

Hi Filter911,

Since my newsreaders automatically underlines everything with a _at_ cahracter embedded between two non-blanks (assuming it's an e-mail address), I had to look twice to see if there were any underscore characters in what you wrote. <g>

But yes - it is correct: % to signify zero or more characters; _ to signify exactly one extra character, then the _at_hotmail. part, then another _ for exactly one more character, followed by % for zero or more extra characters.

If your column is fixed length, you'll have to use RTRIM to get rid of the trailing spaces that are added to fill out the column. For varying length character columns, there's no need to trim.

Best, Hugo

-- 

(Remove _NO_ and _SPAM_ to get my e-mail address)
Received on Tue Nov 29 2005 - 23:36:46 CET

Original text of this message