Comibine a destinct query

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
GK
Forum Commoner
Posts: 51
Joined: Sat Jun 07, 2003 2:58 pm
Contact:

Comibine a destinct query

Post by GK »

hi all

i got an query that gets all country from a table a puts it in my form option table

this is the query
$query = mysql_query ("SELECT DISTINCT country FROM ip ORDER BY country",$db) or die("Sites Database SELECT Error");

if 1 of this countrys is used it will be putted in "land from iptable"

How do i tell in the first query to first look if a country is used in "land from iptable" and then output all the countrys from "country from ip" without the used countrys

Can some one help me out?

greetz
gerd
illiquid050
Forum Newbie
Posts: 4
Joined: Wed Jul 30, 2003 1:44 pm

Post by illiquid050 »

what do you mean by "used" countries...

i guess i'm not understanding your question. The answer may become self-evident if you write out exactly what information you're trying to get.
GK
Forum Commoner
Posts: 51
Joined: Sat Jun 07, 2003 2:58 pm
Contact:

Post by GK »

i got another table that conatins the used domains same names as in the other table


it got it to do a simple sum LOL
Countrys that are used in all rows of iptable shouldn;t be outputed in mij query on the country namen in table ip
Post Reply