Re: Eliminating Multiple Rows
On Tue, 06 May 2008 22:01:09 +0200, Paul Lautman
<paul.lautman@btinternet.com> wrote:
> Warren wrote:
>> On May 6, 1:08 pm, "Rik Wasmus" <luiheidsgoe...@hotmail.com> wrote:
>>> On Tue, 06 May 2008 18:50:20 +0200, Warren <w.gray.mat...@gmail.com>
>>> wrote:
>>> > On May 6, 11:59 am, Captain Paralytic <paul_laut...@yahoo.com>
>>> > wrote:
>>> >> On 6 May, 16:28, Warren <w.gray.mat...@gmail.com> wrote:
>>>
>>> >> > And some sample data. If the system is 2, I want to return only
>>> >> > rows 1, 2, 4, 7, 8 and 9.
>>>
>>> >> > row id name system software
>>> >> > 1 2 Test Package 1 2
>>> >> > 2 4 WLM (Worker 1) NULL NULL
>>> >> > 3 5 WLM (Worker 2) 2 5
>>> >> > 4 6 Inactive Software NULL NULL
>>> >> > 5 9 1234 2 9
>>> >> > 6 9 1234 1 9
>>> >> > 7 10 test 1 10
>>> >> > 8 11 1 NULL NULL
>>> >> > 9 12 Worker Package 1 NULL NULL
>>>
>>> >> > On May 6, 11:23 am, Warren <w.gray.mat...@gmail.com> wrote:
>>>
>>> > I'm
>>> > looking for a query that would return software IDs 1 and 4, given
>>> > system ID 2.
>>>
>>> mysql> SELECT s.id FROM software s
>>> -> LEFT JOIN installs i
>>> -> ON i.software = s.id
>>> -> AND i.system = 2
>>> -> WHERE i.system IS NULL;
>
> Rik beat me to it. Offering sample data like this plus specifying what
> you
> expect from the query makes it really easy for us to help you. Hope to
> see
> you here again.
Yup, more people should just provide create table & sample data
statements, makes it quite easy & clear.
--
Rik Wasmus
|