I tried to do a query to the android sqlite database with the following select, but it shows only error when I put it in eclipse.
stmt = "SELECT * FROM user_zones JOIN pos WHERE user_zones.zone_id = (
CASE
WHEN user_zones.type_zone_id = 'Zone' THEN pos.zone_id
WHEN user_zones.type_zone_id = 'Area' THEN pos.area_id
WHEN user_zones.type_zone_id = 'Town' THEN pos.town_id
WHEN user_zones.type_zone_id = 'MicroZone' THEN pos.microzone_id END) AND user_zones.user_id = '"+id_user+"'";
Has anyone any idea about what is wrong in the above syntax? Thank you
EDIT: I cannot even run the code, there are syntax errors!
Errors:cannot find symbol class CASE
unclosed character literal
cannot find symbol class 'THEN'
expected ';' ....and so on