List:General Discussion« Previous MessageNext Message »
From:Gerald Clark Date:August 21 2002 7:59pm
Subject:Re: help with a query
View as plain text  

Ajay Patel - SunService wrote:

>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
>
SELECT patch.hostid
FROM patch left join host
ON patch.hostid=host.hostid
WHERE patchnumber=109201 and host.hostid is NULL;


Thread
help with a queryAjay Patel - SunService21 Aug
  • RE: help with a queryMary Stickney21 Aug
  • Re: help with a queryGerald Clark21 Aug