List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:July 17 1999 2:45am
Subject:Re: MySQL SELECT Query Question
View as plain text  
At 12:42 AM +0100 7/17/99, Robert W. Castley @ Home wrote:
>HI,
>
>I hope some one out there can help me with a little problem :-
>
>
>Scenario :-
>
>Example ....
>
>I have a database in MySQL with the following example fields and example
>data in database test, tablename friends:-
>
>NAME               STARSIGN        CAR        NICKNAME
>robert                aquarius             volvo        bob
>richard                                          audi         dick
>edward             aries                                    ted
>christopher                                   volvo
>
>Now when you issue SELECT * from friends I would retrieve 4 records.
>
>robert,aquarius,volvo,bob
>richard,NULL,audi,dick
>edward,aries,NULL,ted
>christopher,NULL,volvo,NULL
>
>If I issue SELECT * from friends where car = 'volvo' I would retrieve 2
>records.
>
>robert,aquarius,volvo,bob
>christopher,NULL,volvo,NULL
>
>However if I issue SELECT * from friends where car like '%vol%' and starsign
>like '%' I would retrieve only one record
>
>robert,aquarius,volvo,bob
>
>
>Question :-
>
>How can I create my last SELECT statement above to retrieve the two records
>that have the CAR = volvo ?
>
>Any help or information would gratefully be recieved,

I've seen the replies to this message, and I'm wondering what I'm
missing here:

Your second query does what you want, so ...
Why are you asking how to do what you want?

--
Paul DuBois, paul@stripped
Thread
MySQL SELECT Query QuestionRobert W. Castley @ Home17 Jul
  • Re: MySQL SELECT Query QuestionWayne Topa17 Jul
    • Re: MySQL SELECT Query QuestionWayne Topa17 Jul
  • Re: MySQL SELECT Query QuestionPaul DuBois17 Jul
    • Re: MySQL SELECT Query QuestionCharles Kirby17 Jul
      • Re: MySQL SELECT Query QuestionPaul DuBois17 Jul
      • Re: MySQL SELECT Query QuestionFred Read18 Jul
  • Re: MySQL SELECT Query QuestionPat Sherrill17 Jul
  • Re: MySQL SELECT Query QuestionJim Faucette17 Jul
    • Re: MySQL SELECT Query QuestionMartin Ramsch4 Aug