Re: Got a challenge for ya guys
| From: | Jason | Date: | Tue, 26 Dec 2000 00:21:27 +0000 |
| Subject: | Re: Got a challenge for ya guys | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-31803@lists.php.net to get a copy of this message | ||
select group distinct from table1 where age=2 and
username.table1=username.table2
Jason
----- Original Message -----
From: Noah Spitzer-Williams <noahsw@cyberdude.com>
To: <php-db@lists.php.net>
Sent: Monday, December 25, 2000 2:48 PM
Subject: [PHP-DB] Got a challenge for ya guys
> aight i got these two tables: lets structure them like this:
>
> TABLE1
>
> username | group | sex
> john | 1 | M
> mike | 1 | M
> jen | 2 | F
>
> TABLE2
>
> username | age
> john | 2
> mike | 3
> jen | 2
>
> here what i want to do:
> find how many unique groups are of age '2'
>
> its quite easy to find how many different people are of age '2' but how
can
> i get the number of groups?
>
> also, i dont want to list the same group more than once. i'd like to have
> this all done in mysql so i can calculate how many results (see a search
> engine comin here...hehe)
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
> For additional commands, e-mail: php-db-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>