I'm a beginner in SQL and would like to know if they could help me with an issue.
I have two tables, one is Cadastro_Func and the other CadastroFocal .
'Cadastro_Func' has the columns:
- 'Nickname'
- 'Name'
- 'Cargo'
'Register_Focal' has the columns:
- 'Community'
- 'Nickname'
- 'PontoFocal'
I would like to select the 'FetchPoint' field of the 'FetchCatalogue' table and replace the 'LastName' field with its name in the 'FetchCatalogue' table in addition to the 'Community'.
Example:
Cadastro_Func :
- Nickname: Ale
- Name: Alessandro
- Position: Manager
Fatal_Count :
- Community: Logistics
- Nickname: Ale
- PontoFocal: Rubens
Result :
- Community: Logistics
- Name: Alessandro
- PontoFocal: Rubens
But the real difficulty is to add to this same selection a qualification per job, where:
- Names whose 'Position' is 'Manager' are separated in the 'NameGast' column;
- Names whose 'Title' is 'Coordinator' are separated in the 'ComputerName' column.
It would be something like:
Zip_Func :
Surname - First name - Position
Ale - Alessandro - Manager
Ge - Jorge - Coordinator
Li - Linda - Manager
Register_Focal :
Community - Surname - First name
Logistics - Ale - Rubens
Production - Ge - Luna
P & D - Li - Joseph
Output :
Community - GestetnerName - EngineerName - PontoFocal
Logistica - Alessandro - xxxx - Rubens
Production - xxxx - Jorge - Luna
P & D - Linda - xxxxx - José
Thank you in advance, this is my first question here.