Hi,
I am a beginner with SQL, but seem to have got my head round most concepts, except I am unable to solve this one.
I have a table that lists all countries called "Tbl_Countries". So far there are two fields - CountryName and Europe. I have another table called "Tbl_Master". In "Tbl_Master" there is a field called 'Country_List' which lists countries a person has visited - each country is separated by a semi-colon (. I need to return a true/false (or yes no) value if any country in 'Country_List' has a 'Yes' marked in the 'Europe' field in the 'Tbl_Countries' table in a new field called 'Europe'.
Hope this is clear.
In pseudocode style here is what I need to do:
1- Put each country in 'Country_List' in an array, separating by the ";" symbol
2- Check if any of these countries in the array appears in the table Country_List
3- If it is in country_list, check if field 'Europe' = Yes.
4 - If Yes, Return TRUE, else return false
Example tables, with Europe Flag the sql code I am struggling on.
Tbl_Master
Name Countries Visited Europe Flag?
Adam England; Japan TRUE/Yes
John Australia; Japan FALSE/No
Tbl_Countries
Country Europe
England Yes
Japan No
Australia No