473,406 Members | 2,217 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

I need help below this Query Urgent Please help me..

Hi All,

one column is having no of values separated by comma in the table that any one value should match with some other column of another table one value how to join in oracle

I need result for this query:

Expand|Select|Wrap|Line Numbers
  1.  
  2. SELECT  DISTINCT oeh.ORDER_NUMBER AS sales_order_number,
  3.    oeh.REQUEST_DATE AS CUST_REQ_DATE,
  4.           oeh.ATTRIBUTE10 AS FOC_FRC_DATE,
  5.           rac.CUSTOMER_NAME AS CUSTOMER_NAME,
  6.           oeh.ATTRIBUTE13 AS expedite_indicator,
  7.           oeh.ATTRIBUTE16 AS ENGINEER_ORDER,
  8.           oeh.ATTRIBUTE7 AS OES_ORDER,
  9.           oeh.HEADER_ID,
  10.     XE.EMURL AS QOA_ORDER_SUMMARY_LINK
  11. FROM     oe_order_lines_all oel,
  12.   oe_order_headers_all oeh,
  13.   ra_customers rac,
  14.   oe_transaction_types_tl ott,
  15.   XXQST_EOI_EM_ORACLEE2E XE
  16. WHERE oeh.HEADER_ID=oel.HEADER_ID
  17. AND oeh.SOLD_TO_ORG_ID=rac.CUSTOMER_ID
  18. AND oeh.ORG_ID=(SELECT HOU.ORGANIZATION_ID FROM HR_OPERATING_UNITS HOU where hou.NAME like'%NWX%')
  19. AND oel.FLOW_STATUS_CODE = 'AWAITING_RECEIPT'
  20. AND oel.CANCELLED_FLAG != 'Y'
  21. AND oel.LINE_TYPE_ID= ott.TRANSACTION_TYPE_ID
  22. AND oeh.ORDER_NUMBER not in (SELECT SALES_ORDER_NUMBER FROM XXQST_CUST_NOTIFICATION_TAB)
  23. AND (ott.NAME='NWX Equip' OR ott.NAME='NWX Labor')
  24. AND oeh.ATTRIBUTE10 IS NULL
  25. AND XE.OESORDERID= oeh.ATTRIBUTE7
  26. --AND XE.ENGORDERID= oeh.ATTRIBUTE16;
  27.  
I that last line of the query XE.ENGORDERID is having no.of values suprated by commas
Ex:ENGORDERID :77754916,77755622,77756404,77757356

need to join with any one value should match with attribute16 of oe_order_headers_all

Please help me above the query....

Regards,
Veera.
Mar 10 '08 #1
1 4344
amitpatel66
2,367 Expert 2GB
Try like this:
Expand|Select|Wrap|Line Numbers
  1.  
  2. EXEC EXECUTE IMMEDIATE 'SELECT  DISTINCT oeh.ORDER_NUMBER AS sales_order_number,
  3.    oeh.REQUEST_DATE AS CUST_REQ_DATE,
  4.           oeh.ATTRIBUTE10 AS FOC_FRC_DATE,
  5.           rac.CUSTOMER_NAME AS CUSTOMER_NAME,
  6.           oeh.ATTRIBUTE13 AS expedite_indicator,
  7.           oeh.ATTRIBUTE16 AS ENGINEER_ORDER,
  8.           oeh.ATTRIBUTE7 AS OES_ORDER,
  9.           oeh.HEADER_ID,
  10.     XE.EMURL AS QOA_ORDER_SUMMARY_LINK
  11. FROM     oe_order_lines_all oel,
  12.   oe_order_headers_all oeh,
  13.   ra_customers rac,
  14.   oe_transaction_types_tl ott,
  15.   XXQST_EOI_EM_ORACLEE2E XE
  16. WHERE oeh.HEADER_ID=oel.HEADER_ID
  17. AND oeh.SOLD_TO_ORG_ID=rac.CUSTOMER_ID
  18. AND oeh.ORG_ID=(SELECT HOU.ORGANIZATION_ID FROM HR_OPERATING_UNITS HOU WHERE hou.NAME LIKE'%NWX%')
  19. AND oel.FLOW_STATUS_CODE = 'AWAITING_RECEIPT'
  20. AND oel.CANCELLED_FLAG != 'Y'
  21. AND oel.LINE_TYPE_ID= ott.TRANSACTION_TYPE_ID
  22. AND oeh.ORDER_NUMBER NOT IN (SELECT SALES_ORDER_NUMBER FROM XXQST_CUST_NOTIFICATION_TAB)
  23. AND (ott.NAME='NWX Equip' OR ott.NAME='NWX Labor')
  24. AND oeh.ATTRIBUTE10 IS NULL
  25. AND XE.OESORDERID= oeh.ATTRIBUTE7
  26. AND oeh.ATTRIBUTE16 IN (XE.ENGORDERID)';
  27.  
  28.  
Mar 10 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: phillip.s.powell | last post by:
UPDATE redesign.student SET student_work_area_other SELECT REPLACE('anywhere,(.*)', '$1', i.work_area) AS regexp_col FROM mycompany.interns i, redesign.student s WHERE i.unique_key = s.unique_key...
5
by: Vikas Kumar | last post by:
Hi, I'm not able to convert the following dll import statement in C# to VB.NET. Can any one please help me in this respect?
3
by: Noremac | last post by:
My google skills must be dwindling. I am trying to determine how in ASP.NET 2.0 I can get the ReturnUrl querystring variable in Forms Authentication to contain the absolute url. Just like others...
3
by: Dean Craig | last post by:
I'm working with the new ASP.NET AJAX Control Toolkit. I have a map that has several key areas (hot spots) where when the user hovers over them, I want to pop up a small window with information in...
1
by: write2ashokkumar | last post by:
hi... i have the table like this, Table Name : sample Total Records : 500000 (Consider like this) Sample Records: id ------------ name
2
by: chandra131 | last post by:
Query used in cursor: DECLARE CURSOR2 CURSOR FOR SELECT TDET_DET_PAR_NBR ,TDET_SYS_ID ...
6
by: martin DH | last post by:
**Urgent Need** I'll throw out the basics and any assistance is very, very, very much appreciated! Access 2003 on XP On a form (frmMain) is an option group of check boxes (ReportFrame) from...
2
by: cj | last post by:
My code below gives me "SQL: Column 'BTN' is not found." It will work if I use an inner join or just join but those two joins don't return all the rows. BTN has 5 rows, but arcust01 has only has...
5
by: Justin | last post by:
Here's my XML: <?xml version="1.0" ?> <AppMode Type="Network"> <CurrentFolder Path="c:\tabs"> <Tabs> <FilePath>tabs\Justin.tab</FilePath> <FilePath>tabs\Julie.tab</FilePath> *****There could...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.