I'm trying to write a WHERE clause, which returns all data if the column is empty. I have a csv file (static_table) which consists of:
If the permission is empty that means that the user will need to see everything. So if the hvfg23 user is logged in and runs a query that has country, region and brand, whenever the query is executed the user can see data for every country, for Europe region and all brands.
The query I have at the moment looks something like this:
select * from t1
where(select restriction, type from t2 where user_id = {{current_userId()}} )
I'm having trouble adjusting the query to what exactly I need, the help will be very appreciated.