Distinct records based on condition within a table
Hello PL/SQL Gurus/experts,
I am using Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production version
I have following table -
Note - Table don't have any primary key on Order_ID -
DROP TABLE T;
create table T(Order_ID,Active_Flg) as select
'201002', 'Y' from dual union all select
'201002', '' from DUAL union all select
'201003', '' from dual union all select
'201004', 'Y' from DUAL union all select
'201004', '' from dual union all select
'201005', '' from DUAL ;I want to fetch those Order_ID which have Active-Flg as NULL and don't have the entry for Active_Flg=Y
If use the following then it returns the distinct Order_ID but not the expected one -
SELECT DISTINCT ORDER_ID FROM T WHERE ACTIVE_FLG IS NULL;Result -
ORDER_ID
201004
201002
201003
201005Kindly help.....
try this
with t as
select
'201002' order_id, 'Y' active_flg from dual union all select
'201002', '' from DUAL union all select
'201003', '' from dual union all select
'201004', 'Y' from DUAL union all select
'201004', '' from dual union all select
'201005', '' from DUAL
select order_id
from (
select
order_id,
active_flg,
count(case when active_flg = 'Y' then 1 end) over(partition by order_id) cntY
from t
where cntY = 0 and active_flg is null
Similar Messages
-
Delete duplicate records based on condition
Hi Friends,
I am scratching my head as how to select one record from a group of duplicate records based upon column condition.
Let's say I have a table with following data :
ID START_DATE END_DATE ITEM_ID MULT RETAIL | RETAIL / MULT
1 10/17/2008 1/1/2009 83 3 7 | 2.3333
2 10/17/2008 1/1/2009 83 2 4 | 2
3 10/17/2008 1/1/2009 83 2 4 | 2
4 10/31/2008 1/1/2009 89 3 6 | 2
5 10/31/2008 1/1/2009 89 4 10 | 2.5
6 10/31/2008 1/1/2009 89 4 10 | 2.5
7 10/31/2008 1/1/2009 89 6 6 | 1
8 10/17/2008 10/23/2008 124 3 6 | 2From the above records the rule to identify duplicates is based on START_DATE,+END_DATE+,+ITEM_ID+.
Hence the duplicate sets are {1,2,3} and {4,5,6,7}.
Now I want to keep one record from each duplicate set which has lowest value for retail/mult(retail divided by mult) and delete rest.
So from the above table data, for duplicate set {1,2,3}, the min(retail/mult) is 2. But records 2 & 3 have same value i.e. 2
In that case pick either of those records and delete the records 1,2 (or 3).
All this while it was pretty straight forward for which I was using the below delete statement.
DELETE FROM table_x a
WHERE ROWID >
(SELECT MIN (ROWID)
FROM table_x b
WHERE a.ID = b.ID
AND a.start_date = b.start_date
AND a.end_date = b.end_date
AND a.item_id = b.item_id);Due to sudden requirement changes I need to change my SQL.
So, experts please throw some light on how to get away from this hurdle.
Thanks,
Raj.Well, it was my mistake that I forgot to mention one more point in my earlier post.
Sentinel,
Your UPDATE perfectly works if I am updating only NEW_ID column.
But I have to update the STATUS_ID as well for these duplicate records.
ID START_DATE END_DATE ITEM_ID MULT RETAIL NEW_ID STATUS_ID | RETAIL / MULT
1 10/17/2008 1/1/2009 83 3 7 2 1 | 2.3333
2 10/17/2008 1/1/2009 83 2 4 | 2
3 10/17/2008 1/1/2009 83 2 4 2 1 | 2
4 10/31/2008 1/1/2009 89 3 6 7 1 | 2
5 10/31/2008 1/1/2009 89 4 10 7 1 | 2.5
6 10/31/2008 1/1/2009 89 4 10 7 1 | 2.5
7 10/31/2008 1/1/2009 89 6 6 | 1
8 10/17/2008 10/23/2008 124 3 6 | 2So if I have to update the status_id then there must be a where clause in the update statement.
WHERE ROW_NUM = 1
AND t2.id != t1.id
AND t2.START_DATE = t1.START_DATE
AND t2.END_DATE = t1.END_DATE
AND t2.ITEM_ID = t1.ITEM_IDInfact the entire where_ clause in the inner select statement must be in the update where clause, which makes it totally impossible as T2 is persistent only with in the first select statement.
Any thoughts please ?
I appreciate your efforts.
Definitely this is a very good learning curve. In all my experience I was always writing straight forward Update statements but not like this one. Very interesting.
Thanks,
Raj. -
Retrieve records based on condition from xml using XPATH
Hi all,
I have a table form_content where there are two columns - form_content_id (numeric) and xml_content (clob). The structure of xml_content is
<RAF xmlns="http://www.abnamro.com/WCS/GCEG/KRT">
<XBorderRAF>
<ClientProfile isBranch="1" isBusinessAddressDifferent="1" isSubsidiary="0" regDate="2009-09-01">
<RegisteredAddress city="test" country="GB" nameOfContactPerson="3454545" street1="test" telephoneNumber="34534545"/>
</ClientProfile>
</XBorderRAF>
</RAF>
I want to retrive all form_contant_id from form_content table where country is 'GB' inside RegisteredAddress tag.
I am able to retrive all form_content_id with country value using below query,
SELECT form_content_id,
extractValue(xmltype(xml_content),'/RAF/XBorderRAF/ClientProfile/RegisteredAddress/@country', 'xmlns="http://www.abnamro.com/WCS/GCEG/KRT"')
as registerAddress
from
form_content
but I am finding it difficult to reterive records based on any condition..
SELECT form_content_id,
extractValue(xmltype(xml_content),'/RAF/XBorderRAF/ClientProfile/RegisteredAddress/@country', 'xmlns="http://www.abnamro.com/WCS/GCEG/KRT"')
as registerAddress
from
form_content
where
(extractValue(xmltype(xml_content),'/RAF/XBorderRAF/ClientProfile/RegisteredAddress/@country', 'xmlns="http://www.abnamro.com/WCS/GCEG/KRT"')='GB'
Please help me to resolve this problem. ....
ThanksOk, thaks to all who looked this query, I found the answer
select form_content_id
from xmltest
where existsnode(xmltype(xml_content), '/RAF/XBorderRAF/ClientProfile/RegisteredAddress[@country="GB"]','xmlns="http://www.abnamro.com/WCS/GCEG/KRT"') = 1; -
Retrive records based on condition
HI,
Need some clarification on getting the records based on the condition given.
Here is my requirement. I have developed a function module to search the records based on some input given. For suppose i get some around 10000 records for this condition. Now i need the output records in multiples.
Like first i execute the FM based on the some condition and i should get 100 records as output and the second time i execute the FM with the same search condition i need to get the records from 101 to 200 and the third time i execute and so on.
Is there any way of fetching the records in multiles for the same search criteria. If so can anyone let me know hot to do the same.
Thanks in advance.
Regards,
RamHI Ram
Please check this example to get some idea:
tables: vbak.
data: it_vbak type table of vbak,
wa_vbak1 type vbak,
wa_vbak2 type vbak.
data: lin type i.
select-options: s_erdat for vbak-erdat obligatory.
select * into table it_vbak from vbak
package size 10
where erdat in s_erdat.
describe table it_vbak lines lin.
read table it_vbak into wa_vbak1 index 1.
read table it_vbak into wa_vbak2 index lin.
break-point.
endselect.
Check the entries in IT_VBAK whenever the break-point is reached. You will have a fresh set of entries for every collection.
Hope this gives you some idea.
Kind Regards
Eswar -
Get Distinct records with a condition
I have a table with multiple records per Person and an active status column. I would like to fetch distinct records by PersonID and PersonName but also return active status with a condition that if person is active on at least one he is considered active.
Here is my table.
DECLARE @Person TABLE (PersonID INT, PersonName VARCHAR(50), DeptName VARCHAR(50), Active bit)
INSERT INTO @Person (PersonID, PersonName, DeptName, Active) VALUES (111, 'John', 'Finance', 0), (111, 'John', 'HR', 1),(222, 'Jack', 'Payroll', 0),(333, 'Mark', 'Facilities', 1),(444, 'Bill', 'IT', 0),(444, 'Bill', 'HR', 1),(444, 'Bill', 'Finance', 1)
My resultset after the query should be as follows.
(111, 'John', 1),(222,'Jack',0),(333,'Mark',1),(444,'Bill',1)
Thanks for the help.>> I have a table with multiple records [sic] per Person and an active status column. <<
Rows are not records. Tables have to have a key by definition and since they model a set, the names are plural or collective. These are fundamentals that were covered in the first few chapters of any book on RDBMS. You do not know ISO-11179 naming rules.
You still use assembly language bit flags in SQL! A status is a state of being so it requires a temporal component. Do you really know people with FIFTY character name? Even in Poland and India, that is not likely. But when you allow garbage data, you will
get it.
Identifiers are CHAR(n), not numeric; what math do you do with them? Again, this is a fundamental of data modeling.
You are simply reenforcing your bad habits and not taking the time to learn how to do RDBMS correctly.
CREATE TABLE Personnel --- collective name!
(person_id CHAR(3) NOT NULL,
person_name VARCHAR(10) NOT NULL,
dept_name VARCHAR(10)NOT NULL,
hire_date DATE NOT NULL,
termination_date DATE,
CHECK (hire_date < termination_date),
PRIMARY KEY (person_id, hire_date)); -- null means current.
See how a valid design makes finding a status possible? And it shows us just what a mess you have! Bill is working in TWO departments! See how the key prevents this error? We should add more constraints, but I do not think you are ready for that yet.
SELECT person_id, person_name, dept_name AS current_dept_name
FROM Personnel
WHERE termination_date IS NULL;
--CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
in Sets / Trees and Hierarchies in SQL -
Loop at Conditions within internal table
I have not been ABAPing long so primarily have been using keyword help...
I am trying to loop round an itab and only select and process unique keys from within the table!
However the table I am using to obtain the records has multiple records with the same reference and I am only interested in each unique occurrence of the IBASE_COMPONENT_GUID field.
So there could be four items for one Appliance and four for another one. So of the eight records, I would only need to loop round and select the unique GUIDS.
So there would only be two unique appliances I need to extract the records for.
Basically I am trying to do something like this:
LOOP AT GT_ITEM_DATA INTO GS_ITEM_DATA WITH UNIQUE KEY IBASE_COMPONENT_GUID.
Is there a way to select each unique occurrence?Basically, I use the COLLECT statement when I need to get the unique field (character only) field from the internal table.
Create a table with only one field, GUID.
LOOP through your main table, assign its GUID to new table's field GUID
Use COLLECT new_table.
Other option is,
Sort the table by GUID
Loop through it and use AT NEW GUID or AT END OF GUID
Fill out the table with this GUID.
Regards,
Naimesh Patel -
Validation based on conditions in another table
Hi All,
I'm trying to do a before update validation based on a condition. Basically, if the value of table1.columnA is changed to Yes only save when there are no rows in table2 columnX = Yes, otherwise online error.
I have tried expressions, boolean, etc. and can't quite get the right combination.
I am looking at something like select Y from dual where count of T2.CX = Yes is >1 otherwise N, and generate error only when Y is returned.
Any help is appreciated.Thanks for the help. I did get it working, but in a way completely opposite than I was thinking it should work.
FYI -
The validation is expression 1 is contained in expression 2
expression one is the p15_task_closed
expression two is NO
add a condition Exists (Sql returns a row)
then do the select from the other table where it is true!
I guess it says look at the conditions first, if the condition is true check the validation. If the validation is TRUE then no error, if the validation is FALSE (in this case the p15_task_closed = YES) enforce the validation error. -
Select distinct record based on column
Hello All,
I have a table that has more than one row as Detail for a single invoice number(screenshot below). When I create report based on this table, I get multiple rows for single invoice. I mean Invoice 000027 shows up with 5 different rows on the SSRS report.
Is there a way I could display a single row for a single invoice? Any thoughts on this will be greatly appreciated. Thanks.
Regards,
Amol
eport )Thank you all for your suggestions. The issue is how can I get single distinct columns after joining 2 tables (InvoiceHeader & InvoiceDetail). I am using following query in my dataset.
SELECT DISTINCT I.recid, I.InvNumber, D.Detail, I.CompanyName, I.Addr1, I.SalesRep, I.JobNumber, I.Status, I.InvDate, I.TotalInvAmount
FROM InvoiceHeader AS I INNER JOIN
InvoiceDetails AS D ON I.InvNumber = D.InvoiceNumber
WHERE (I.InvNumber = @InvoiceNumber) AND (I.InvDate >= @StartDate) AND (I.InvDate <= @EndDate) AND (I.CompanyName IN (@Customer)) AND (I.Status IN (@Status)) OR
(I.InvDate >= @StartDate) AND (I.InvDate <= @EndDate) AND (I.CompanyName IN (@Customer)) AND (I.Status IN (@Status)) AND (I.JobNumber = @JobNo) OR
(I.InvNumber = @InvoiceNumber) AND (I.InvDate >= @StartDate) AND (I.InvDate <= @EndDate) AND (I.CompanyName IN (@Customer)) AND (I.Status IN (@Status))
AND (@JobNo = '') OR
(I.InvDate >= @StartDate) AND (I.InvDate <= @EndDate) AND (I.CompanyName IN (@Customer)) AND (I.Status IN (@Status)) AND (I.JobNumber = @JobNo) AND
(@JobNo = '') OR
(I.InvDate >= @StartDate) AND (I.InvDate <= @EndDate) AND (I.CompanyName IN (@Customer)) AND (I.Status IN (@Status)) AND (@JobNo = '') AND
(@InvoiceNumber = '')
ORDER BY I.InvNumber DESC
Thanks again.
Amol -
Deleting Records based on status in another table
Dear All,
I am using oracle 11gR1 on Linux.
We have two tables one holding year starting and closing dates with year status as open/closed for multiple years and multiple entities. Any year may be open for an entity.
Relevant columns/Pk
PK: entity_id, fin_year_id
Cols: year_st_dt, year_end_dt, year_status
We have another table where monthly summarized information is stored via scheduled procedure. Currently the procedure deletes all records and inserts new records.
Relevant columns/Pk
Cols: entity_id, year_month
What we want is that the procedure should not delete records that related to financial years that are closed.
How would I write a delete statement to do that?
Regards, ImranHi,
957 posts, but still while posting a question, you have not
1) Posted the table structure of all the tables involved. (create statement)
2) Posted the sample input (insert statement)
3) Posted the sample output.
4) More importantanly posted on the correct forum.
Regards
Anurag Tibrewal. -
Update one table based on condition from another table using date ranges
Hello!
I have two tables:
DateRange (consists of ranges of dates):
StartDate FinishDate
Condition
2014-01-02
2014-01-03 true
2014-01-03
2014-01-13
false
2014-01-13
2014-01-14 true
Calendar (consists of three-year dates):
CalendarDate IsParental
2014-01-01
2014-01-02
2014-01-03
2014-01-04
2014-01-05
2014-01-06
2014-01-07
2014-01-08
2014-01-09
2014-01-10
I want to update table Calendar by setting IsParental=1
for those dates that are contained in table DateRange between
StartDate and FinishDate AND Condition IS TRUE.
The query without loop should look similar to this but it works wrong:
UPDATE
Calendar
SET IsParental = 1
WHERE
CalendarDate BETWEEN
(SELECT
StartDate
FROM DateRange
WHERE Calendar. CalendarDate = DateRange. StartDate
AND
(SELECT StartDate
FROM DateRange
WHERE Calendar. CalendarDate = DateRange. FinishDate
AND Condition
IS TRUE
Is it possible to do without loop? Thank you for help!
AnastasiaHi
Please post DDL+DML next time :-)
-- This is the DDL! create the database structure
create table DateRange(
StartDate DATE,
FinishDate DATE,
Condition BIT
GO
create table Calendar(
CalendarDate DATE,
IsParental BIT
GO
-- This is the DML (insert some sample data)
insert DateRange
values
('2014-01-02', '2014-01-03', 1),
('2014-01-03', '2014-01-13', 0),
('2014-01-13', '2014-01-14', 1)
GO
insert Calendar(CalendarDate)
values
('2014-01-01'),
('2014-01-02'),
('2014-01-03'),
('2014-01-04'),
('2014-01-05'),
('2014-01-06'),
('2014-01-07'),
('2014-01-08'),
('2014-01-09'),
('2014-01-10')
select * from DateRange
select * from Calendar
GO
-- This is the solution
select CalendarDate
from Calendar C
where EXISTS (
select C.CalendarDate
FROM DateRange D
where C.CalendarDate between D.StartDate and D.FinishDate and D.Condition = 1
UPDATE Calendar
SET IsParental = 1
from Calendar C
where EXISTS (
select C.CalendarDate
FROM DateRange D
where C.CalendarDate between D.StartDate and D.FinishDate and D.Condition = 1
[Personal Site] [Blog] [Facebook] -
Fetching Records Based on Condition
hi all,
i am having some problem in getting the records from three tables.could anybody there to help me out of this.....
there are three tables SUB,TICKETS and INDTICKETS.
In the first table SUB(master table)which contains the masters.
In the second table TICKET(detail table) which contains the tickets belongs to the subscriber in the master(SUB)table.
So if we want to see the tickets(2 each) of one subscriber belongs to which routeid we can combine the 2 tables and get it since routeid is in the SUB master table.
Sometimes all tickets wouldnt belongs to the same routeid whatever specified in the SUB master.So i created the another INDTICKET table which will save the routeid ticketid wise.So the INDTICKET Table will contains tickets which are only having routeid is been changed.
DESC SUB
SUBNO SUBNAME ROUTEID
1 SMITH 01
2 SCOTT 02
DESC TICKETS
SUBNO TICKETID AMOUNT
1 01 1000
1 02 2000
2 09 4000
2 10 7000
DESC INDTICKET
SUBNO TICKETID ROUTEID
1 02 02
2 10 01
Now i need a query which will fetch only the tickets
1 . belongs to 01 routeid in the SUB master table and not in the INDTICKET table of other routeid
2 . and the ticketid belongs to the 01 routeid in the INDTICKET table.
So from the above example the query should fetch like this
=== Tickets in routeid '01' ===
SUBNO SUBNAME TICKETID AMOUNT
1 SMITH 01 1000
2 SCOTT 10 7000
thanks in advance
regrds,
punithIn the future, it would be much more helpful if you could post the DDL to create and populate these tables instead of DESC and query output. It would greatly increase the chances of having your question answered.
I would probably have put the routeid override as an additional column in the tickets table instead of creating a new table just for the override, but with your current layout:
sql>select * from sub;
SUBNO SUBNAME ROUTEID
1 Smith 1
2 Scott 2
2 rows selected.
sql>select * from tickets;
SUBNO TICKETID AMOUNT
1 1 1000
1 2 2000
2 9 4000
2 10 7000
4 rows selected.
sql>select * from indticket;
SUBNO TICKETID ROUTEID
1 2 2
2 10 1
2 rows selected.
sql>select s.subno, s.subname, t.ticketid, t.amount
2 from sub s, tickets t
3 where s.routeid = 1
4 and t.subno = s.subno
5 and not exists (select null
6 from indticket it
7 where it.subno = s.subno
8 and it.ticketid = t.ticketid)
9 union all
10 select s.subno, s.subname, it.ticketid, t.amount
11 from indticket it, sub s, tickets t
12 where it.routeid = 1
13 and s.subno = it.subno
14 and t.subno = s.subno
15 and t.ticketid = it.ticketid;
SUBNO SUBNAME TICKETID AMOUNT
1 Smith 1 1000
2 Scott 10 7000
2 rows selected. -
Select the record based count condition
Hi Experts
I have a table with columns StateDate,State,Name & Type . For the same date there could be 2 or more rows for the same name .
I need to retrieve the data from the table only for the name containing single row in the table and state = 'On'
Please find the Create & Insert Scripts below . Am assuming it needs to be done with a window function and am not yet comfortable with window function .
CREATE TABLE ItemState
(StateDate Date,
State Varchar(3),
Name Varchar(3),
Type int)
INSERT INTO Itemstate (Statedate,State,Name,Type)
Values ('3/11/2014','On','XYZ',1)
INSERT INTO Itemstate (Statedate,State,Name,Type)
Values ('3/11/2014','Off','XYZ',1)
INSERT INTO Itemstate (Statedate,State,Name,Type)
Values ('3/11/2014','On','ABC',1)
INSERT INTO Itemstate (Statedate,State,Name,Type)
Values ('3/12/2014','Off','CBR',1)
INSERT INTO Itemstate (Statedate,State,Name,Type)
Values ('3/12/2014','On','CBR',1)
INSERT INTO Itemstate (Statedate,State,Name,Type)
Values ('3/12/2014','On','XYZ',1)
Expected Result
StateDate
State
Name
Type
3/11/2014
ON
ABC
1
3/12/2014
ON
XYZ
1
Kindly help
Thanks
PriyaINSERT INTO Itemstate (Statedate,State,Name,Type)
Values ('3/11/2014','On','XYZ',1)
INSERT INTO Itemstate (Statedate,State,Name,Type)
Values ('3/11/2014','Off','XYZ',1)
INSERT INTO Itemstate (Statedate,State,Name,Type)
Values ('3/11/2014','On','ABC',1)
INSERT INTO Itemstate (Statedate,State,Name,Type)
Values ('3/12/2014','Off','CBR',1)
INSERT INTO Itemstate (Statedate,State,Name,Type)
Values ('3/12/2014','On','CBR',1)
INSERT INTO Itemstate (Statedate,State,Name,Type)
Values ('3/12/2014','On','XYZ',1)
again adding this 3 rows
INSERT INTO Itemstate (Statedate,State,Name,Type)
Values ('3/11/2014','On','XYZ',1)
INSERT INTO Itemstate (Statedate,State,Name,Type)
Values ('3/11/2014','Off','XYZ',1)
INSERT INTO Itemstate (Statedate,State,Name,Type)
Values ('3/11/2014','On','ABC',1)
SELECT *
FROM itemstate order by statedate, name,state
2014-03-11 On
ABC 1
2014-03-11 On
ABC 1
2014-03-11 Off
XYZ 1
2014-03-11 Off
XYZ 1
2014-03-11 On
XYZ 1
2014-03-11 On
XYZ 1
2014-03-12 Off
CBR 1
2014-03-12 On
CBR 1
2014-03-12 On
XYZ 1
so only xyz on 2014-03-12 will qualify
WITH test
AS (SELECT *,
row_number()
OVER (
partition BY statedate, name
ORDER BY state ASC) rnasc,
count(state)
OVER (
partition BY statedate, name
ORDER BY state desc) rncount
FROM itemstate)
SELECT *
FROM test t1 where rnasc = 1
and state = 'on' and rncount = 1
Amish shah
http://bloq.sqltechie.com -
Spliting files based on condition using multi mapping with BPM
Hi All,
Can any one please let me know How to <b>Splite the outbound records based on condition using multi mapping with Integration Process in BPM</b>?
Thanks
Govindu.Hi All,
Sorry for mistake this question for Exchange infrastructure guys.
Thanks,
Govindu -
Hi All,
Hope you are doing great!
I have the following query.
SELECT DISTINCT DT.STD_ID STDID,
UP.FIRST_NAME FIRSTNAME,
UP.LAST_NAME LASTNAME,
DT.TYPE ROLE,
NVL2 (CT.USER_ID, 'Y', 'N') CKCTEAM,
CT.USER_ID
FROM DEAL D,
DEAL_TEAM DT,
CKC_TEAM CT,
USER_PROFILE UP
WHERE D.DEAL_ID = DT.DEAL_ID
AND DT.STD_ID = UP.STD_ID
AND D.DEAL_ID = 'D0002064';
And the following result.
STDID FIRSTNAME LASTNAME ROLE CKCTEAM USER_ID
V285773 MAHIA ANNA CREATEBY Y E067448
E015989 JACQU CARR EDITOR Y E067448
V285773 MAHIA ANNA BANKER Y E067448
O256285 ALLA OLWEN EDITOR Y E067448
I need the results to have distinct records based on the first name and last name irrespective of the roles. Now you can see from the result set that there is a duplicate record for "MAHIA ANNA" since the user has 2 different roles.
Appreciate your help on this.
Thanks in advance
MNUse query from my previous post, if you want to group your records only by names. Or this, if you want to group by all except role.
SELECT DT.STD_ID STDID,
UP.FIRST_NAME FIRSTNAME,
UP.LAST_NAME LASTNAME,
max(DT.TYPE) ROLE,
NVL2 (CT.USER_ID, 'Y', 'N') CKCTEAM,
CT.USER_ID
FROM DEAL D,
DEAL_TEAM DT,
CKC_TEAM CT,
USER_PROFILE UP
WHERE D.DEAL_ID = DT.DEAL_ID
AND DT.STD_ID = UP.STD_ID
AND D.DEAL_ID = 'D0002064' group by DT.STD_ID,UP.FIRST_NAME, UP.LAST_NAME,CT.USER_ID; -
Value Set whose Data come from customize table with distinct record
Dear All,
I am new in Oracle EBS, currently i am creating value set whose data come from customize table which have 40 duplicate record in which distinct column return 27 record .
Table XX_ROUND_SET
Columns (Transactions_id,set_record)
Total Record (40)
Distinct Record (Set_Record --> 27)
I just want to show only 27 record in it.
Thanks
RehanHi Rehan,
PL.IGNORE MY EARLIER UPDATE AND TREAT THIS UPDATE AS YOUR SOLUTION.
Method 1
Create the VIEW based on DISTINCT values; use the VIEW for creates the VALUESET.
Method 2
Paste the QUERY in TABLE field with alias name, and give the column name (with alias name).
(in your case )
TABLE NAME : ( select distinct transactions_id, set_record from XX_ROUND_SET ) Y
VALUE : Y.transactions_id
HTH
Sanjay
Maybe you are looking for
-
Want to create a InDesign document that is Interactive as a PDF
I want to create an InDesign form that is made into a PDF that can be filled out (populated with their answers) and returned via email to someone. Can I make the document in InDesign or do I have to do it in Acrobat? I am running CS2. If you can poin
-
Homeshared songs won't sync!!
Hi, so recently a member of my family bought an album on iTunes. I imported it to my iTunes library using Homeshare and tried to get it onto my iPad Mini... to no avail.. Does anyone know how to fix this? I've done this many times before with no issu
-
Hi All, I have a file to HTTP syncronus scenario. To test the http URL i wrote a java program and tested it standalone from my PC with method POSTand it is working fine( ie i was getting a response). However when i use the same URL in XI(
-
What's the default mysql database name in Crystal Report Server XIR2
Hi Experts, I am upgrading Crystal Report Server from XIR2 to XI3.1. I need to know the default mysql database name when upgrading. Anyone knows?
-
Does UNICODE support the Euro? I see everywhere that the Western Eurpean char sets do, but nothing about the UNICODE set. Thank you, Todd Holtmann [email protected]