Is anybody else getting similar emails after sending an email to the
php-db list? I don't understand any of this 2006 google group with 5
members.
-------- Original Message --------
Subject: Kesalahan posting: Don Komo
Date: Thu, 31 Jan 2008 09:17:40 +0000
From: noreply@xxxxxxxxxxxxxxxx
To: evert.lammerts@xxxxxxxxx
Anda tidak memiliki izin untuk memposting ke grup donkomo. Anda mungkin
harus bergabung ke grup agar dibolehkan memposting atau grup ini mungkin tidak
dapat terbuka untuk memposting.
Kunjungi http://groups.google.com/group/donkomo/about?hl=id untuk bergabung atau
mempelajari lebih lanjut tentang siapa yang dibolehkan memposting ke grup.
Bantuan untuk menggunakan Google Groups juga tersedia di:
http://groups.google.com/support?hl=id
--- Begin Message ---
Not completely sure what type of result you expect, but here's one that makes sense to me.
SELECT tour.record_id, tour.event_start_date, tour.event_end_date, tour.event_name, angler_results.result
FROM tour
LEFT JOIN angler_results
ON angler_results.tour_id = tour.record_id
AND angler_results.angler_id = 1
I've taken out the CASE - I personally never worked with that and I'd probably put a default value of 'N/A' in the column angler_results.result. The DISTINCT has to go too, I'm guessing that the relation tour.record_id -> angler_results.tour_id is 1 -> *. The LEFT join CAN stay (as far as I know OUTER is only necessary when using ODBC or for maintaining compatibility with it, and then I'm still not sure what it does), if you want to have all rows in tour regardless of the join condition with NULL values for angler_results.result where tour.record_id is not in angler_results.tour_id. To leave out the NULL values use an INNER JOIN instead.
Evert
Bastien Koert wrote:
Hi All,
Got myself stuck in a little sql here and can't seem to work out what I am doing wrong
SELECT
DISTINCT (tour.record_id), tour.event_start_date, tour.event_end_date, tour.event_name,CASE WHEN result is NULLTHEN 'N/A'ELSE angler_results.resultEND CASE
FROM
tourLEFT OUTER JOIN angler_results
ON angler_results.tour_id = tour.record_idWHERE angler_results.angler_id =1
where the table TOUR is as above in the primary part of the select and table ANGLER_RESULTS is (record_id, tour_id, angler_id, result)
Any ideas?
Bastien
_________________________________________________________________
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php