Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
james_hanify
Creator
Creator

Merging data in two data fields with SQL

Hi all,

So my data structure is a bit annoying but what I have is an invoice, invoicedetails and inventory. I am using SQL to pull the information initially so i assume i'll have to do two or more passes on the data, though the more efficient route would be my preferred option.

If it is a custom item, the details of it will be stored in inventory, i was going to do similar to this

if invoicedetails hasn't got the product information then get it from the inventory.

Then the item's proper detail can be added as another table, only the name is kept within invoicedetails.

Example:

InventoryDetails

InvoiceItemKeyItemKeyProductDescription
JIGS*SALE*I1234*1G000AAACustom Cable
JIGS*SALE*I1234*2MD233BA
JIGS*SALE*I1235*1NS-3929BA


Inventory

ItemKeyProductDescription
MD233BAApple madness pro
NS-3929BASome amazing device

JOINED InventoryDetails

InvoiceItemKeyItemKeyProductDescription
JIGS*SALE*I1234*1G000AAACustom Cable
JIGS*SALE*I1234*2MD233BAApple madness pro
JIGS*SALE*I1235*1NS-3929BASome amazing device

Many thanks,

James.

11 Replies
vinieme12
Champion III
Champion III

No,  there is no limit .

Do you get any error message?

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
james_hanify
Creator
Creator
Author

School boy error, i copied and pasted and forgot to change the as name

Thanks