I am trying to write SQL that will show the invoice_head details and every invoice_line(purchase orders). The catch is for everytime there is a purchase order over the first row, you don't repeat the invoice head row.
I have attached a excel spreadsheets that show the format of invoice that I need. It shows my current SQL output, the required SQL output there is also the schema for the tables and sample data.
Columns A-V from Invoice_head
Columns W-AL from Invoice_line
(some of the headings in excel are changed from table name)
Maybe another way to think of it is invoice head is the parent and invoice line is the child. Show every child record but only show the parent data(invoice head) for the first child record(invoice line).
e.g.
Head----Line
1--------1
null------2
null------3
2--------1
3--------1
4--------1
null------2
I have attached a excel spreadsheets that show the format of invoice that I need. It shows my current SQL output, the required SQL output there is also the schema for the tables and sample data.
Columns A-V from Invoice_head
Columns W-AL from Invoice_line
(some of the headings in excel are changed from table name)
Maybe another way to think of it is invoice head is the parent and invoice line is the child. Show every child record but only show the parent data(invoice head) for the first child record(invoice line).
e.g.
Head----Line
1--------1
null------2
null------3
2--------1
3--------1
4--------1
null------2