age-
> From: Jay Blanchard [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, May 02, 2002 6:59 PM
> To: 'savaidis'; [EMAIL PROTECTED]
> Subject: RE: get one for each row
>
>
> [snip from mysql list message]
> I tried
>
> and worked.
> But how can I show all fie
[snip from mysql list message]
I tried
and worked.
But how can I show all fields of the rows?
It doesn't accept any field before and shows every row after
(if I put )
[/snip]
Can we see your table? Can you also write out what you expect the results to
be?
Thanks!
Jay Blanchard
--
gt; To: 'savaidis'; [EMAIL PROTECTED]
> Subject: RE: get one for each row
>
>
> [snip]
> I have one table with about 1000 hotels and name or the city they belong.
> I want to run a query to get one row for every city only, to put it in a
> pull down menu in the
[snip]
It might be faster to instead of getting the list of cities and then in
seperate queries get all hotels for each city, to just sort by city and
fetch all, and in your application check if it has found a next city
already.
[/snip]
Of course, you could use a single crosstab query and get som
It might be faster to instead of getting the list of cities and then in
seperate queries get all hotels for each city, to just sort by city and
fetch all, and in your application check if it has found a next city
already.
Example in php:
$res=mysql_query('select hotel,city from hotels order by ci
[snip]
I have one table with about 1000 hotels and name or the city they belong.
I want to run a query to get one row for every city only, to put it in a
pull down menu in the search form.
How is that?
[/snip]
SELECT DISTINCT city
FROM tblFOO
So if you have this table;
+---+
savaidis,
Thursday, May 02, 2002, 11:07:18 AM, you wrote:
s> I have one table with about 1000 hotels and name or the city they belong.
s> I want to run a query to get one row for every city only, to put it in a
s> pull down menu in the search form.
s> How is that?
Try SELECT DISTINCT city FROM y
Try this
Table : col1 : col2
1. Hotel 1
$col2
}
?>
Pradeep
Naharonline.com
- Original Message -
From: "savaidis" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, May 02, 2002 1:37 PM
Subject: get one for each row
>
> I have one table with about 1