on 08-21-2009 7:37 PM
Hi Gurus,
I had 2 DB tables, one is header and the other is item.
i need to join these two tables and must get the result of these in to my source.
Header fields: REFERENCE,COMP_NUMBER,CUST_NUMBER,STATUS
Item fields:reference,UPC,description,
For example in my header table i had a record for reference = '100', then in item table i had 3 records for reference = '100',
then how can i retreive all the records that has a same reference numbers from both header and item.
Thanks for your help.
Srinivas
Solved by myself
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Select Header.REFERENCE,Header.COMP_NUMBER,Header.CUST_NUMBER,Header.STATUS,Item.reference,Item.UPC,Item.description from Header,Item where Header.reference = Item.reference.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Srinivas,
You need to create datatype which has all the fields for header and item under one like Record and then select the fields using a join in these two tables. So in your example all the 3 records would come and the header will repeat 3 times with different items.
Please write the sql query by looking at this blog. It should be straight forward.
https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/1725 [original link is broken] [original link is broken] [original link is broken]
Regards,
---Satish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
As per my requirements, i wrote a query like as below
select * from TMP_HEADER INNER JOIN TMP_DETAIL on TMP_HEADER.REFERENCE = TMP_DETAIL.REFERENCE where TMP_DETAIL.REFERENCE in (select top 1 TMP_HEADER.REFERENCE from TMP_HEADER where TMP_HEADER.status = 'READY')
but the communication is not picking up the record in the table, Can you please suggest what may be the issue?
Thanks for your help
Srinivas
User | Count |
---|---|
89 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.