>-----Original Message-----
>From: Tompkins Neil [mailto:neil.tompk...@googlemail.com]
>Sent: Tuesday, September 21, 2010 11:48 AM
>To: Johan De Meersman
>Cc: [MySQL]
>Subject: Re: SELECT WHERE IN help
>
>Thanks for the reply.  The search of  (3,4,5,6,7,3)  is pulling data from a
>table.  I think in this case I need to change my design .
>
[JS] You can accomplish your goal by using a sub-select to create a "table" 
that has 3 in it twice, and then JOIN it to the original table.

As for why you would want to do this, that's another story. It sounds like you 
went down the wrong road.

Regards,

Jerry Schwartz
Global Information Incorporated
195 Farmington Ave.
Farmington, CT 06032

860.674.8796 / FAX: 860.674.8341
E-mail: je...@gii.co.jp
Web site: www.the-infoshop.com




>On Tue, Sep 21, 2010 at 4:46 PM, Johan De Meersman <vegiv...@tuxera.be>wrote:
>
>> I don't think that'll work, no. Why would you want to return duplicate data
>> ? The whole point of an RDBMS is to *avoid* duplicate data :-)
>>
>>
>> On Tue, Sep 21, 2010 at 5:44 PM, Tompkins Neil <
>> neil.tompk...@googlemail.com> wrote:
>>
>>> Thanks for the quick reply.  Basically in (3,4,5,6,7,3) the record_id of
>>> 3 only exists once in the table my_table.  However, because 3 exists
>>> twice within  (3,4,5,6,7,3), I want it to return two records for
>>> record_id 3.  Is it possible ?
>>>
>>> Cheers
>>> Neil
>>>
>>>
>>> On Tue, Sep 21, 2010 at 4:40 PM, Johan De Meersman
><vegiv...@tuxera.be>wrote:
>>>
>>>> If there are two, you will return two.
>>>>
>>>>
>>>> On Tue, Sep 21, 2010 at 5:33 PM, Tompkins Neil <
>>>> neil.tompk...@googlemail.com> wrote:
>>>>
>>>>> Hi
>>>>>
>>>>> With a SELECT * FROM my_table WHERE record_id IN (3,4,5,6,7,3), how can
>>>>> I
>>>>> return two records for the record_id 3 ?  Is it possible ?
>>>>>
>>>>> Cheers
>>>>> Neil
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Bier met grenadyn
>>>> Is als mosterd by den wyn
>>>> Sy die't drinkt, is eene kwezel
>>>> Hy die't drinkt, is ras een ezel
>>>>
>>>
>>>
>>
>>
>> --
>> Bier met grenadyn
>> Is als mosterd by den wyn
>> Sy die't drinkt, is eene kwezel
>> Hy die't drinkt, is ras een ezel
>>




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql?unsub=arch...@jab.org

Reply via email to