Hello and thanks for your attention
I need to convert data from two different lines into one line.
Let s imagine
ORDERS table:
ID    Name    adress   
-------------------- 
01    AA      adr1
02    BB      adr2
03    CC      adr3
LINEORDERS table:
ID    IDorder    IDprofileType     ProfileType      idPers   
------------------------------------------------------------- 
01    01         01                Organizer        0045
01    01         02                Present          0085
01    01         02                Present          0032
01    01         03                Manager          0018
Lets imagine we want as result >
Desired result:
IDorder   NameOrder     OrganizerID           PresentID           ManagerID       Diff
------------------------------------------------------------- 
01        AA            0045                  0085                0018            yes
01        AA            0045                  0032                0018            yes
Diff is yes if managerID and organizerID are different.
How can I get such a result?
Do I need to create T-SQL temporary tables? What would be the lighter?
I have a lot of lines in the table.
Thanks for your help
 
     
     
     
    