1
I’m a beginner in SQL and I was wondering if you could help me with a question.
I have two tables, one is called Cadastro_func and the other Cadastre.
The 'Func_register' has the columns:
- 'Nickname'
- 'Name'
- 'Office'
'Focal Register' has columns:
- 'Commune'
- 'Nickname'
- 'Pointed'
I would like to select the field 'Pontofocal' of the table 'Focal Register' and replace the field 'Nickname' by the respective table name 'Func Register', in addition to 'Community'.
Example:
Cadastro_func:
- Nickname: Ale
- Name: Alessandro
- Office: Manager
Focal register:
- Commune: Logistic
- Nickname: Ale
- Pointed: Rubens
Upshot:
- Commune: Logistic
- Name: Alessandro
- Pointed: Rubens
But the real difficulty is to add to this same selection a qualification per position, where:
- Names whose Position is "Manager" are separated in the column 'Manager name';
- Names whose 'Position' is "Coordinator" are separated in the column 'Coordinator name'.
It would be something like:
Cadastro_func:
Surname - First name - Title
Ale - Alessandro - Manager
Ge - Jorge - Coordinator
Li - Linda - Manager
Focal register:
Community - Surname - First name
Logistica - Ale - Rubens
Production - Ge - Luna
R&D - Li - José
Exit:
Community - Nomegestor - Nomecoordenador - Pontofocal
Logistica - Alessandro - xxxx - Rubens
Production - xxxx - Jorge - Luna
R&D - Linda - xxxxx - José
Thanks in advance, it’s my first question here.