select hostid,patch.patchnumber from host
left join patch on host.hostid = patch.hostid
where patchnumber isnull


-----Original Message-----
From: Ajay Patel - SunService [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 21, 2002 2:27 PM
To: [EMAIL PROTECTED]
Subject: help with a query



I am a beginner at SQL and would appreciate any help with a simple
query.

I have two tables:

host
patch

The host table contains details for a particular host (OS, cpus, memory,
etc)
and the patch table contains patches installed on that host.

For example:

Host:

hostid          hostname        OS      cpus    memory
8000abcd        abacus          2.6     4       1024
8001abce        quark           2.8     1       512
8008efd1        sharp           2.9     2       2048

Patch:

hostid          patchnumber     patchversion
8000abcd        105181          31
8000abcd        109201          01
8000abcd        108701          15

8001abce        108528          12
8001abce        108655          10
8001abce        106655          07
.
.
.

I am trying to write a query that would list all hosts that
do not have a particular patch installed.

TIA,
Ajay


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail
<[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to