basic query question

This is a discussion on basic query question within the MySQL Database forums, part of the Database Forums category; Not sure if i am asking this the right way but - Can anyone tell me what the symbol is for '...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 05-09-2006
Mike
 
Posts: n/a
Default basic query question

Not sure if i am asking this the right way but -

Can anyone tell me what the symbol is for 'contains' instead of 'equals' ?.

i.e

SELECT * FROM datasearch WHERE email = '@'

I need to change this to

SELECT * FROM datasearch WHERE email CONTAINS '@'





Reply With Quote
  #2 (permalink)  
Old 05-09-2006
Good Man
 
Posts: n/a
Default Re: basic query question

"Mike" <me@privacy.net> wrote in
news:1261grak0kond78@corp.supernews.com:

> Not sure if i am asking this the right way but -
>
> Can anyone tell me what the symbol is for 'contains' instead of
> 'equals' ?.
>
> i.e
>
> SELECT * FROM datasearch WHERE email = '@'
>
> I need to change this to
>
> SELECT * FROM datasearch WHERE email CONTAINS '@'


SELECT * FROM datasearch WHERE email LIKE '%@%'


Reply With Quote
  #3 (permalink)  
Old 05-09-2006
Mike
 
Posts: n/a
Default Re: basic query question


"Good Man" <heyho@letsgo.com> wrote in message
news:Xns97BE7FDDBB9C9sonicyouth@216.196.97.131...
> "Mike" <me@privacy.net> wrote in
> news:1261grak0kond78@corp.supernews.com:
>
>> Not sure if i am asking this the right way but -
>>
>> Can anyone tell me what the symbol is for 'contains' instead of
>> 'equals' ?.
>>
>> i.e
>>
>> SELECT * FROM datasearch WHERE email = '@'
>>
>> I need to change this to
>>
>> SELECT * FROM datasearch WHERE email CONTAINS '@'

>
> SELECT * FROM datasearch WHERE email LIKE '%@%'
>



thank you, i tried LIKE but was missing %


question. can you think of a query to show me the email field that has
content but not containing the @ symbol

ie. SELECT * FROM datasearch WHERE email = something but excluding @












Reply With Quote
  #4 (permalink)  
Old 05-09-2006
Good Man
 
Posts: n/a
Default Re: basic query question

"Mike" <me@privacy.net> wrote in
news:1261ijbo0v2m1ac@corp.supernews.com:

>>> SELECT * FROM datasearch WHERE email = '@'
>>>
>>> I need to change this to
>>>
>>> SELECT * FROM datasearch WHERE email CONTAINS '@'

>>
>> SELECT * FROM datasearch WHERE email LIKE '%@%'
>>

>
>
> thank you, i tried LIKE but was missing %
>
>
> question. can you think of a query to show me the email field that
> has content but not containing the @ symbol
>
> ie. SELECT * FROM datasearch WHERE email = something but excluding @


my guess (not tested) would be:

SELECT * FROM datasearch WHERE email NOT LIKE '%@%'

Reply With Quote
  #5 (permalink)  
Old 05-09-2006
Mike
 
Posts: n/a
Default Re: basic query question


"Good Man" <heyho@letsgo.com> wrote in message
news:Xns97BE84974F998sonicyouth@216.196.97.131...
> "Mike" <me@privacy.net> wrote in
> news:1261ijbo0v2m1ac@corp.supernews.com:
>
>>>> SELECT * FROM datasearch WHERE email = '@'
>>>>
>>>> I need to change this to
>>>>
>>>> SELECT * FROM datasearch WHERE email CONTAINS '@'
>>>
>>> SELECT * FROM datasearch WHERE email LIKE '%@%'
>>>

>>
>>
>> thank you, i tried LIKE but was missing %
>>
>>
>> question. can you think of a query to show me the email field that
>> has content but not containing the @ symbol
>>
>> ie. SELECT * FROM datasearch WHERE email = something but excluding @

>
> my guess (not tested) would be:
>
> SELECT * FROM datasearch WHERE email NOT LIKE '%@%'
>


ok thx. that would show all the blank rows to though. i need to find a
way to show the rows with something entered but exclude the @ or exclude
both the empty and @.
its got me stumped


Reply With Quote
  #6 (permalink)  
Old 05-09-2006
strawberry
 
Posts: n/a
Default Re: basic query question

You need to add the bit about there being 'something' in the field -
so;

SELECT email1address FROM contacts WHERE email1address NOT LIKE '%@%'
AND email1address NOT LIKE '' ;

Reply With Quote
  #7 (permalink)  
Old 05-09-2006
Mike
 
Posts: n/a
Default Re: basic query question


"strawberry" <zac.carey@gmail.com> wrote in message
news:1147195071.743560.88220@e56g2000cwe.googlegro ups.com...
> You need to add the bit about there being 'something' in the field -
> so;
>
> SELECT email1address FROM contacts WHERE email1address NOT LIKE '%@%'
> AND email1address NOT LIKE '' ;
>


thats the one thank you


Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 07:35 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0