abbiz
Civil/Environmental
- Oct 27, 2005
- 1
SELECT DISTINCT
countries.land,
CASE WHEN visits.trotterid='2'
THEN visits.trotterid
ELSE '0' end test
FROM countries
left JOIN visits
ON countries.landid=visits.landid
I have a website with a list of countries(countries.land)
Customer should after registrating(trotterid) shoose a country or more from the list. The site should remember the shoosen countries. I can list as below with the above script, but I don´t want denmark to be listed twise.
Any Ideas?
land test
sweden 2
Danmark 0
Damnark 2
Norge 0
Finland 0
table countries
landid land
1 sverige
2 Danmark
3 Norge
4 Finland
table trotter
trotterid namn email
1 Albin at@prologic.se
2 kalle kalle@prologic.se
table visits
nr landid trotterid
1 1 2
2 2 1
3 2 2
countries.land,
CASE WHEN visits.trotterid='2'
THEN visits.trotterid
ELSE '0' end test
FROM countries
left JOIN visits
ON countries.landid=visits.landid
I have a website with a list of countries(countries.land)
Customer should after registrating(trotterid) shoose a country or more from the list. The site should remember the shoosen countries. I can list as below with the above script, but I don´t want denmark to be listed twise.
Any Ideas?
land test
sweden 2
Danmark 0
Damnark 2
Norge 0
Finland 0
table countries
landid land
1 sverige
2 Danmark
3 Norge
4 Finland
table trotter
trotterid namn email
1 Albin at@prologic.se
2 kalle kalle@prologic.se
table visits
nr landid trotterid
1 1 2
2 2 1
3 2 2