List:General Discussion« Previous MessageNext Message »
From:Dan Nelson Date:June 5 2002 5:45pm
Subject:Re: Comparing array elements
View as plain text  
In the last episode (Jun 05), Chris Knipe said:
> Does anyone have and ideas of wisdom on how to compare arrays (mysql
> result sets) and group items based on if they exist in two or more
> arrays?
> 
> Now, I want to compare group1 against the server list, and do something like
> the following:
> In group:
>   server1
>   server4
>   server5

SELECT servers.server FROM servers LEFT JOIN group1 ON
 servers.server=group1.server WHERE group1.server IS NOT NULL;


> Not in group:
>   server2
>   server3
>   serverX

SELECT servers.server FROM servers LEFT JOIN group1 ON
 servers.server=group1.server WHERE group1.server IS NULL;

-- 
	Dan Nelson
	dnelson@stripped
Thread
Comparing array elementsChris Knipe5 Jun
  • Re: [PHP] Comparing array elementsPushkar Pradhan5 Jun
  • Re: Comparing array elementsDan Nelson5 Jun
  • Re: Comparing array elementsChris Knipe5 Jun