0
I have the following appointment:
SELECT despesa.codRequisicao,
despesa.histDespesa,
despesa.despesaPassagem, despesa.despesaTaxi, despesa.despesaHotel, despesa.despesaRefeicao, despesa.despesaOutros
FROM despesa;
Where the result displays this way:
1 hist1 0 200 0 0 0
1 hist2 0 0 600 0 0
I need the result to stay this way:
1 hist1 despesaTaxi 200
1 hist2 despesaHotel 600
How do you do?
Where do you have the information of "Farewell" and "Farewell"? It is in another table than the expense?
– CesarMiguel
It is in the same table...in these fields (expense.dismissePassage, expense.dismisseTaxi, expense.dismisseHotel, expense.dismissesReffection, expense.dismissesOther)
– mcardoso
Never has more than one expense on the same line? The table structure was thought to have.
– bfavaretto
Without a doubt, it would be more interesting to rethink the structure, where it would have a column that saved the type of expenditure and one with the value of the expenditure, this would avoid this type of structure.
– Rodrigo Coelho