Re: How I can use multiple results in MySQL
| From: | Sigitas Paulavicius | Date: | Mon, 23 Apr 2001 14:32:23 +0000 |
| Subject: | Re: How I can use multiple results in MySQL | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-8813@lists.php.net to get a copy of this message | ||
> SELECT name FROM cia WHERE region =
> (SELECT region FROM table WHERE name = 'Brazil');
would be:
SELECT cia.name
FROM cia, table
WHERE cia.region=table.region
AND table.name='Brazil'
> SELECT name FROM table WHERE count =
> (SELECT max(count) FROM table);
if there may be more than one record having maximum value, you will have to
run two separate queries
Sigitas