I have the following table:
|--------|----------------|-------------|
| url | description | for_region |
|--------|----------------|------------ |
| url1 | desc1 | All |
| url2 | desc2 | All |
| url2 | desc3 | Germany |
|--------|----------------|-------------|
Now I am trying to write the following query without if else statements:
IF EXISTS (SELECT 1 FROM my_table where for_country='Germany') THEN
select * from my_table where for_country='Germany'
ELSE
select * from my_table where for_country='All'
END IF;
What is the best way to rewrite the above query without the use of if-else statements?