I have two configuration tables, one general and one specific:
table configurations :
codigo contenido
codigo_ga UA-GENERICO
table configurations_domains :
dominio_id idioma codigo contenido
1 es_ES codigo_ga UA-DOM1-ES
2 (NULL) codigo_ga UA-DOM2-GENERICO
2 es_ES codigo_ga UA-DOM2-ES
The language and the domain I always have to pass it in the query, but the language (in the specified table) is optional. Example:
- For domain 1 in Spanish, "UA-DOM1-ES" should be displayed.
- For domain 1 in English, "UA-GENERICO" should be displayed.
- For domain 2 in Spanish "UA-DOM-ES".
- and for any language in domain 2, "UA-DOM2-GENERICO" should be displayed
Is this possible in a single query and bringing only one value per "code"?