I have two tables (1-N relationship).
(ID,name,surname),
(ID,Job(s),role,society).
In my app I want to merge table1 and table2 (based on the id that binds the two tables) BUT i want to hide the columns that COULD be empty.
Example: (in this case, i don't want to show 'ruolo/grado')
How I wrote the code for this:
CREATE PROCEDURE spEstraiPbyId
@Id int
as
begin
SELECT * from Persone
join Lavori on Persone.Id = @Id and Lavori.IdPersona=@Id
end
PS: I have already seen several similar questions on the internet but no answer was able to satisfy my request or I did not understand correctly. I hope you can help me willingly.