Returning more then one row and changing to selecting by moditifcation date
i've adapted the query below from an older one, it has to return one result and the subquerys are there to make sure it does not just return a number but a string with a bit more meaning, I also have to change it now so that it selects on the last 5 updated records, and there is a mod date I could use for that. But I still have to figure out how. Any help is welcome.
select * from ( SELECT ticketid,
applicatiecd,
categorieid,
substr(titel,1, 200)||' ...'
klantprioriteitid,
interneprioriteitid,
( select g.voornaam||' '||g.naam
from gebruiker g, ticket t
where g.gebruikerid = t.gebruikerid
and t.applicatiecd = NVL(:P0_APPLICATIECD,:F101_APPLICATIECD)) "aangemaakt door",
( select s.statusdefoms "status"
from status s, ticket t
where s.statusid = t.statusid
and t.APPLICATIECD = NVL(:P0_APPLICATIECD,:F101_APPLICATIECD)) "status",
versieid,
row_number() over (order by ticketid desc) rn
FROM ticket where applicatiecd = NVL(:P0_APPLICATIECD,:F101_APPLICATIECD) ) where rn <= 5;
corrected query, should work:
select * from ( SELECT ticketid,
applicatiecd,
categorieid,
substr(titel,1, 200)||' ...'
klantprioriteitid,
interneprioriteitid,
( select g.voornaam||' '||g.naam
from gebruiker g
where g.gebruikerid = t.gebruikerid
and t.applicatiecd = NVL(:P0_APPLICATIECD,:F101_APPLICATIECD)) "aangemaakt door",
( select s.statusdefoms "status"
from status s
where s.statusid = t.statusid
and t.APPLICATIECD = NVL(:P0_APPLICATIECD,:F101_APPLICATIECD)) "status",
versieid,
row_number() over (order by ticketid desc) rn
FROM ticket t
where applicatiecd = NVL(:P0_APPLICATIECD,:F101_APPLICATIECD) )
where rn <= 5;
Similar Messages
-
Update returned more then one row
Hi ,
Can you help me with this?
I have the following:
update admuser.udfvalue
set udf_number=
(select sum(nvl(uv.udf_number,0))
from admuser.projwbs pw, admuser.udfvalue uv
where pw.proj_id=uv.proj_id
group by pw.proj_id, pw.parent_wbs_id, pw.phase_id,
uv.proj_id,pw.wbs_name, pw.wbs_name)
where proj_id = any
(select pw.proj_id
from admuser.projwbs pw, admuser.udfvalue uv
where pw.proj_id=uv.proj_id
group by pw.proj_id, pw.parent_wbs_id, pw.phase_id,
uv.proj_id,pw.wbs_name, pw.wbs_name)
and the error: ERROR at line 3:
ORA-01427: single-row subquery returns more than one row
thank youHi,
You subselect isn't linked to your target table,
update admuser.udfvalue target
set udf_number =
( select sum(nvl(uv.udf_number, 0))
from admuser.projwbs pw
where pw.proj_id = target.proj_id
group by pw.proj_id
,pw.parent_wbs_id
,pw.phase_id
,pw.proj_id
,pw.wbs_name
,pw.wbs_name)
where proj_id = any ( select pw.proj_id
from admuser.projwbs pw, admuser.udfvalue uv
where pw.proj_id = uv.proj_id
group by pw.proj_id
,pw.parent_wbs_id
,pw.phase_id
,uv.proj_id
,pw.wbs_name
,pw.wbs_name);Regards
Peter -
ORA-01427:single-row sub query returns more than one row (group by)
Hello every one, I am very new to this field , and Right now I am working with this sql, where BEG_BAL_WKST,WKST_RECEIVED_NUM,WKST_PROCESSED_NUM,WKST_CANCELED_NUM are needs to be grouped by,but I am getting the "single-row sub query returns more than one row".
This is the query I am using in my source qualifier:
select
SUM(tmp.WIP_TO_BILL_LOC_AMT) AS WIP_TO_BILL_LOC_AMT,
sum(tmp.REALIZATION_LOC_AMT) AS REALIZATION_LOC_AMT,
SUM(tmp.NEG_REAL_LOC_AMT) AS NEG_REAL_LOC_AMT,
sum(tmp.POS_REAL_LOC_AMT) AS POS_REAL_LOC_AMT,
sum(tmp.BILL_IN_ADVANCE_LOC_AMT) AS BILL_IN_ADVANCE_LOC_AMT,
sum(tmp.CARRY_FORWARD_LOC_AMT) AS CARRY_FORWARD_LOC_AMT,
sum(tmp.BILL_TO_CLIENT_LOC_AMT) AS BILL_TO_CLIENT_LOC_AMT,
sum(tmp.REMAIN_WIP_TO_BILL_LOC_AMT) REMAIN_WIP_TO_BILL_LOC_AMT,
sum(tmp.AR_INV_AMT) AS AR_INV_AMT,
sum(tmp.AR_TAX_AMT) AS AR_TAX_AMT,
tmp.BEG_BAL_WKST_NUM AS BEG_BAL_WKST_NUM,
tmp.WKST_RECEIVED_NUM AS WKST_RECEIVED_NUM,
tmp.WKST_PROCESSED_NUM AS WKST_PROCESSED_NUM,
tmp.WKST_CANCELED_NUM AS WKST_CANCELED_NUM,
tmp.DURATION AS DURATION,
tmp.NUM_DAYS AS NUM_DAYS,
tmp.NUM_HOURS AS NUM_HOURS,
tmp.NUM_MINUTES AS NUM_MINUTES,
tmp.NUM_SECONDS AS NUM_SECONDS,
tmp.LEAD_PROJECT_OFFICE_CODE AS LEAD_PROJECT_OFFICE_CODE,
tmp.LEAD_PROJECT_TEAM_CODE AS LEAD_PROJECT_TEAM_CODE,
tmp.ORG_ID AS ORG_ID,
tmp.RPT_DATE AS RPT_DATE,
tmp.RPT_DATE_WID AS RPT_DATE_WID,
tmp.LOCAL_CURR_CODE AS LOCAL_CURR_CODE,
tmp.USD_EXCH_RATE AS USD_EXCH_RATE,
tmp.EUR_EXCH_RATE AS EUR_EXCH_RATE,
tmp.GBP_EXCH_RATE AS GBP_EXCH_RATE
from(
SELECT
WIP_TO_BILL_LOC_AMT as WIP_TO_BILL_LOC_AMT ,
REALIZATION_LOC_AMT AS REALIZATION_LOC_AMT,
NEG_REAL_LOC_AMT AS NEG_REAL_LOC_AMT ,
POS_REAL_LOC_AMT AS POS_REAL_LOC_AMT,
BILL_IN_ADVANCE_LOC_AMT AS BILL_IN_ADVANCE_LOC_AMT ,
CARRY_FORWARD_loc_AMT AS CARRY_FORWARD_LOC_AMT,
bill_to_client_LOC_AMT AS BILL_TO_CLIENT_LOC_AMT ,
REMAIN_WIP_TO_BILL_LOC_AMT AS REMAIN_WIP_TO_BILL_LOC_AMT,
AR_inv_AMT AS AR_INV_AMT,
ar_tax_amt AS AR_TAX_AMT,
(SELECT count(distinct(RPAD(INTEGRATION_ID,32)))
FROM wc_twfs_olb_invoice_history_f
WHERE ((inv_status_type='FIN'AND inv_status_code NOT IN ('COMPLETE','PROCESSED'))
OR (inv_status_type='WS' AND inv_status_code NOT IN ('PRC'))) --COMPLETED
AND to_char((sysdate-5),'YYYYMMDD') between to_char(status_start_dt,'YYYYMMDD') and to_char(status_end_dt,'YYYYMMDD')group by rpad(integration_id,32)) AS BEG_BAL_WKST_NUM ,
(SELECT count(distinct(RPAD(INTEGRATION_ID,32)))
FROM wc_twfs_olb_invoice_history_f
WHERE (inv_status_code='NEW')
AND to_char((sysdate-4),'YYYYMMDD') between to_char(status_start_dt,'YYYYMMDD') and to_char(status_end_dt,'YYYYMMDD')group by rpad(integration_id,32))AS WKST_RECEIVED_NUM ,
(SELECT count(distinct(RPAD(INTEGRATION_ID,32)))
FROM wc_twfs_olb_invoice_history_f
WHERE ((inv_status_type='FIN' and inv_status_code IN ('COMPLETE','PROCESSED'))
OR (inv_status_type='WS' AND inv_status_code IN ('PRC'))) --COMPLETED
AND to_char((sysdate-4),'YYYYMMDD') between to_char((status_start_dt),'YYYYMMDD') and to_char((status_end_dt),'YYYYMMDD')group by rpad(integration_id,32))AS WKST_PROCESSED_NUM ,
(SELECT count(distinct(RPAD(INTEGRATION_ID,32)))
FROM wc_twfs_olb_invoice_history_f
WHERE (inv_status_type='FIN' AND inv_status_code='CANCELLED')
AND to_char((sysdate-4),'YYYYMMDD') between to_char((status_start_dt),'YYYYMMDD') and to_char((status_end_dt),'YYYYMMDD')group by rpad(integration_id,32)) AS WKST_CANCELED_NUM,
DURATION AS DURATION,
NUM_DAYS AS NUM_DAYS,
NUM_HOURS AS NUM_HOURS,
NUM_MINUTES AS NUM_MINUTES,
NUM_SECONDS AS NUM_SECONDS,
lead_project_office_code AS LEAD_PROJECT_OFFICE_CODE,
lead_project_team_code AS LEAD_PROJECT_TEAM_CODE,
org_id AS ORG_ID,
trunc(sysdate-1) AS RPT_DATE,
to_char((sysdate-1),'YYYYMMDD') AS RPT_DATE_WID,
--last_day(a.report_date) mth_end_dt,
LOC_CURR_CODE AS LOCAL_CURR_CODE,
usd_exch_rate AS USD_EXCH_RATE,
eur_exch_rate AS EUR_EXCH_RATE,
gbp_exch_rate AS GBP_EXCH_RATE
FROM Wc_twfs_olb_invoice_history_f
Where
RPT_DT_MCAL_PERIOD_WID =(select max(RPT_DT_MCAL_PERIOD_WID)from Wc_twfs_olb_invoice_history_f))tmp
group by BEG_BAL_WKST_NUM,WKST_RECEIVED_NUM,WKST_PROCESSED_NUM,WKST_CANCELED_NUM,DURATION,NUM_DAYS,NUM_HOURS,NUM_MINUTES,NUM_SECONDS,
LEAD_PROJECT_OFFICE_CODE,LEAD_PROJECT_TEAM_CODE,ORG_ID,RPT_DATE,RPT_DATE_WID,
LOCAL_CURR_CODE,USD_EXCH_RATE,EUR_EXCH_RATE,GBP_EXCH_RATE;
Can you please suggest me what to do next, and what would be the solution to this.
Thanks a lot in advance. please show me some direction.you may want to change it something like
SELECT SUM(Wip_To_Bill_Loc_Amt) AS Wip_To_Bill_Loc_Amt,
SUM(Realization_Loc_Amt) AS Realization_Loc_Amt,
SUM(Neg_Real_Loc_Amt) AS Neg_Real_Loc_Amt,
SUM(Pos_Real_Loc_Amt) AS Pos_Real_Loc_Amt,
SUM(Bill_In_Advance_Loc_Amt) AS Bill_In_Advance_Loc_Amt,
SUM(Carry_Forward_Loc_Amt) AS Carry_Forward_Loc_Amt,
SUM(Bill_To_Client_Loc_Amt) AS Bill_To_Client_Loc_Amt,
SUM(Remain_Wip_To_Bill_Loc_Amt) AS Remain_Wip_To_Bill_Loc_Amt,
SUM(Ar_Inv_Amt) AS Ar_Inv_Amt,
SUM(Ar_Tax_Amt) AS Ar_Tax_Amt,
COUNT(DISTINCT CASE
WHEN ((Inv_Status_Type = 'FIN' AND
Inv_Status_Code NOT IN ('COMPLETE', 'PROCESSED')) OR
(Inv_Status_Type = 'WS' AND Inv_Status_Code NOT IN ('PRC'))) --COMPLETED
AND To_Char((SYSDATE - 5), 'YYYYMMDD') BETWEEN
To_Char(Status_Start_Dt, 'YYYYMMDD') AND
To_Char(Status_End_Dt, 'YYYYMMDD') THEN
Rpad(Integration_Id, 32)
END) AS Beg_Bal_Wkst_Num,
/*(SELECT COUNT(DISTINCT(Rpad(Integration_Id, 32)))
FROM Wc_Twfs_Olb_Invoice_History_f
WHERE ((Inv_Status_Type = 'FIN' AND
Inv_Status_Code NOT IN ('COMPLETE', 'PROCESSED')) OR
(Inv_Status_Type = 'WS' AND Inv_Status_Code NOT IN ('PRC'))) --COMPLETED
AND To_Char((SYSDATE - 5), 'YYYYMMDD') BETWEEN
To_Char(Status_Start_Dt, 'YYYYMMDD') AND
To_Char(Status_End_Dt, 'YYYYMMDD')
GROUP BY Rpad(Integration_Id, 32)) AS Beg_Bal_Wkst_Num,
(SELECT COUNT(DISTINCT(Rpad(Integration_Id, 32)))
FROM Wc_Twfs_Olb_Invoice_History_f
WHERE (Inv_Status_Code = 'NEW')
AND To_Char((SYSDATE - 4), 'YYYYMMDD') BETWEEN
To_Char(Status_Start_Dt, 'YYYYMMDD') AND
To_Char(Status_End_Dt, 'YYYYMMDD')
GROUP BY Rpad(Integration_Id, 32)) AS Wkst_Received_Num,
(SELECT COUNT(DISTINCT(Rpad(Integration_Id, 32)))
FROM Wc_Twfs_Olb_Invoice_History_f
WHERE ((Inv_Status_Type = 'FIN' AND
Inv_Status_Code IN ('COMPLETE', 'PROCESSED')) OR
(Inv_Status_Type = 'WS' AND Inv_Status_Code IN ('PRC'))) --COMPLETED
AND To_Char((SYSDATE - 4), 'YYYYMMDD') BETWEEN
To_Char((Status_Start_Dt), 'YYYYMMDD') AND
To_Char((Status_End_Dt), 'YYYYMMDD')
GROUP BY Rpad(Integration_Id, 32)) AS Wkst_Processed_Num,
(SELECT COUNT(DISTINCT(Rpad(Integration_Id, 32)))
FROM Wc_Twfs_Olb_Invoice_History_f
WHERE (Inv_Status_Type = 'FIN' AND Inv_Status_Code = 'CANCELLED')
AND To_Char((SYSDATE - 4), 'YYYYMMDD') BETWEEN
To_Char((Status_Start_Dt), 'YYYYMMDD') AND
To_Char((Status_End_Dt), 'YYYYMMDD')
GROUP BY Rpad(Integration_Id, 32)) AS Wkst_Canceled_Num,*/
Duration AS Duration,
Num_Days AS Num_Days,
Num_Hours AS Num_Hours,
Num_Minutes AS Num_Minutes,
Num_Seconds AS Num_Seconds,
Lead_Project_Office_Code AS Lead_Project_Office_Code,
Lead_Project_Team_Code AS Lead_Project_Team_Code,
Org_Id AS Org_Id,
Trunc(SYSDATE - 1) AS Rpt_Date,
To_Char((SYSDATE - 1), 'YYYYMMDD') AS Rpt_Date_Wid,
--last_day(a.report_date) mth_end_dt,
Loc_Curr_Code AS Local_Curr_Code,
Usd_Exch_Rate AS Usd_Exch_Rate,
Eur_Exch_Rate AS Eur_Exch_Rate,
Gbp_Exch_Rate AS Gbp_Exch_Rate
FROM Wc_Twfs_Olb_Invoice_History_f
WHERE Rpt_Dt_Mcal_Period_Wid =
(SELECT MAX(Rpt_Dt_Mcal_Period_Wid)
FROM Wc_Twfs_Olb_Invoice_History_f)
GROUP BY Beg_Bal_Wkst_Num,
Wkst_Received_Num,
Wkst_Processed_Num,
Wkst_Canceled_Num,
Duration,
Num_Days,
Num_Hours,
Num_Minutes,
Num_Seconds,
Lead_Project_Office_Code,
Lead_Project_Team_Code,
Org_Id,
Rpt_Date,
Rpt_Date_Wid,
Local_Curr_Code,
Usd_Exch_Rate,
Eur_Exch_Rate,
Gbp_Exch_Rate;Edited by: 986006 on Mar 4, 2013 1:08 PM -
Update column with subquery returning more than one row
Hi Everybody,
Please let me know how to handle this. I am writing update statement in procedure with subquery and it is returning multiple rows. Please help me, how i can handle this :
UPDATE TABLEA A
SET A.ERROR_MESSAGE = (Select B.XERROR_MESSAGE from TABLEB B, TABLEA A WHERE B.id = A.id)
WHERE A.id = (Select B.id from TABLEB B, TABLEA A WHERE B.id = A.id);
(Select B.XERROR_MESSAGE from TABLEB B, TABLEA A WHERE B.id = A.id) --- This subquery is returning more than one rows. How i can handle this in Pl/SQL?
Please let me know. I will be very thankful to you all.
I will really appreciate your replies and comments.
Thank youTry getting rid of tablea in your subqueries. You already have it in the UPDATE statement.
UPDATE TABLEA A
SET A.ERROR_MESSAGE = (Select B.XERROR_MESSAGE
from TABLEB B
WHERE B.id = A.id
WHERE A.id = (Select B.id
from TABLEB B
WHERE B.id = A.id);You can also try a simple MERGE:
merge into tablea a
using tableb b
on (a.id = b.id)
when matched then update
set a.error_message = b.xerror_message; -
ORA-01427: single-row subquery returns more than one row -- no solution
Hello to all:
I have to tables:
Table a anwender (Email,Dept). --> all fields are filled
Table b dingo (Name,email,dept) --> all fields are filled
I now want to update the table a with the data from table b:
update anwender a set a.abteilung = ( select distinct b.abteilung from dingo b where b.email = a.email);
Then I got the error: ORA-01427: single-row subquery returns more than one row
Every dept is about 100x in the database, so it is clear that i got more than one row back. But how can I update the table now?Okay, I got several duplicates, and I deletet a lot of data in my database.
Now I want to remove all entries with more than one departments per mail adresses.
a
select email,count(abteilung) from dingo group by email having count(abteilung)>1 order by count(abteilung)
shows me all the fake mailadresses.
But a
delete from dingo where email in (select email,count(abteilung) from dingo group by email having count(abteilung)>1 order by count(abteilung) );
gives me a
SQL Error: ORA-00907: missing right parenthesis
I´m very confused now ...
Oops, now I got the solution:
delete from dingo where email in (select email from (select email,count(abteilung) from dingo group by email having count(abteilung)>1 )) ;
Edited by: user8309218 on Dec 18, 2009 6:24 AM -
TWO ERRO ORA-01427: single-row subquery returns more than one row
Hi,
I have a procedure which contains a cursor. If i run the select statement in the cursor separetly, it returns only value and works fine. But the same select statement in the cursor of a procedure throws me the error as below:
TWO ERRO ORA-01427: single-row subquery returns more than one row
Not sure what going on...any help appreciated.
Below is the select statement:
SELECT DISTINCT PSE.PARENT_POSITION_ID,
(SELECT DISTINCT PPD1.SEGMENT2
FROM PER_POSITION_DEFINITIONS PPD1,
HR_ALL_POSITIONS_F HAPF2,
PER_POS_STRUCTURE_ELEMENTS PSE2
WHERE TRUNC(SYSDATE) BETWEEN
HAPF2.EFFECTIVE_START_DATE AND
HAPF2.EFFECTIVE_END_DATE
AND PPD1.POSITION_DEFINITION_ID =
HAPF2.POSITION_DEFINITION_ID
AND
HAPF2.POSITION_ID = PSE2.PARENT_POSITION_ID
AND PSE2.PARENT_POSITION_ID =
PSE.PARENT_POSITION_ID
AND ROWNUM = 1) SEGMENT2,
(SELECT DISTINCT PAPF1.FIRST_NAME || ' ' ||
PAPF1.LAST_NAME CHIEF_NAME
FROM PER_ALL_PEOPLE_F PAPF1,
PER_ALL_ASSIGNMENTS_F PAAF1
WHERE TRUNC(SYSDATE) BETWEEN
PAPF1.EFFECTIVE_START_DATE AND
PAPF1.EFFECTIVE_END_DATE
AND TRUNC(SYSDATE) BETWEEN
PAAF1.EFFECTIVE_START_DATE AND
PAAF1.EFFECTIVE_END_DATE
AND PAAF1.POSITION_ID = PSE.PARENT_POSITION_ID
AND PAPF1.PERSON_ID = PAAF1.PERSON_ID
AND ROWNUM = 1) CHIEF_NAME
FROM PER_POS_STRUCTURE_ELEMENTS PSE,
HR_ALL_POSITIONS_F HAPF,
PER_POSITION_DEFINITIONS PPD
WHERE PSE.SUBORDINATE_POSITION_ID = 52744
AND TRUNC(SYSDATE) BETWEEN HAPF.EFFECTIVE_START_DATE AND
HAPF.EFFECTIVE_END_DATE
AND HAPF.POSITION_ID = PSE.SUBORDINATE_POSITION_ID
AND HAPF.POSITION_DEFINITION_ID = PPD.POSITION_DEFINITION_ID;
Thanks
PK
Edited by: user539616 on Jun 30, 2009 6:30 PMHi,
The cursor has a different parameter? Maybe the query is not exactly the same. Could you check this?
This is your query (formatted):
SELECT DISTINCT PSE.PARENT_POSITION_ID,
(SELECT DISTINCT PPD1.SEGMENT2
FROM PER_POSITION_DEFINITIONS PPD1,
HR_ALL_POSITIONS_F HAPF2,
PER_POS_STRUCTURE_ELEMENTS PSE2
WHERE TRUNC(SYSDATE) BETWEEN HAPF2.EFFECTIVE_START_DATE AND
HAPF2.EFFECTIVE_END_DATE
AND PPD1.POSITION_DEFINITION_ID = HAPF2.POSITION_DEFINITION_ID
AND HAPF2.POSITION_ID = PSE2.PARENT_POSITION_ID
AND PSE2.PARENT_POSITION_ID = PSE.PARENT_POSITION_ID
AND ROWNUM = 1) SEGMENT2,
(SELECT DISTINCT PAPF1.FIRST_NAME || ' ' || PAPF1.LAST_NAME CHIEF_NAME
FROM PER_ALL_PEOPLE_F PAPF1,
PER_ALL_ASSIGNMENTS_F PAAF1
WHERE TRUNC(SYSDATE) BETWEEN PAPF1.EFFECTIVE_START_DATE AND
PAPF1.EFFECTIVE_END_DATE
AND TRUNC(SYSDATE) BETWEEN PAAF1.EFFECTIVE_START_DATE AND
PAAF1.EFFECTIVE_END_DATE
AND PAAF1.POSITION_ID = PSE.PARENT_POSITION_ID
AND PAPF1.PERSON_ID = PAAF1.PERSON_ID
AND ROWNUM = 1) CHIEF_NAME
FROM PER_POS_STRUCTURE_ELEMENTS PSE,
HR_ALL_POSITIONS_F HAPF,
PER_POSITION_DEFINITIONS PPD
WHERE PSE.SUBORDINATE_POSITION_ID = 52744
AND TRUNC(SYSDATE) BETWEEN HAPF.EFFECTIVE_START_DATE AND HAPF.EFFECTIVE_END_DATE
AND HAPF.POSITION_ID = PSE.SUBORDINATE_POSITION_ID
AND HAPF.POSITION_DEFINITION_ID = PPD.POSITION_DEFINITION_ID;Tips: To put formatted code you must use {noformat}{noformat} tags, start tag and end tag are the same,you don't need to put '/' in the close tag.
Regards, -
How to find out which sub query returns more than one row
Hi all,
Can any one give me clue ,how to find out which sub query returns more than one row in the following query .
/* Formatted on 2011/05/17 19:22 (Formatter Plus v4.8.8) */
SELECT a.*, ROWNUM AS rnm
FROM (SELECT DISTINCT '1' AS "Page View", ou.org_unit_name AS "Org",
prxm.mbr_idntfr AS "Beneficiary ID",
md.last_name
|| ', '
|| md.first_name AS "Beneficiary Name",
pci.idntfr AS "Tracking No.",
TO_CHAR (TRUNC (req.pa_rqst_date),
'MM/dd/yyyy'
) AS "Request Date",
sts.status_name AS "Status",
req.pa_rqst_sid AS "Request #",
prxm.mbr_sid AS "Mbr_sid",
TO_CHAR
(TRUNC (req.pa_revision_date),
'MM/dd/yyyy'
) AS "Last Updated",
TO_CHAR (psd.TO_DATE, 'MM/dd/yyyy') AS "TO_DATE",
prxpl.prvdr_lctn_iid AS "PRVDR_LCTN_IID",
pd.prvdr_sid AS "PRVDR_SID", 'Y' AS "State View",
DECODE
((SELECT DISTINCT pd.national_prvdr_idntfr
FROM pa_request_x_provider_location prxplo
WHERE prxplo.pa_rqst_sid =
req.pa_rqst_sid
AND prxplo.oprtnl_flag = 'A'
AND prxplo.pa_prvdr_type_lkpcd = 'RR'),
0, (SELECT prxplo.prvdr_lctn_idntfr
FROM pa_request_x_provider_location prxplo
WHERE prxplo.pa_rqst_sid = req.pa_rqst_sid
AND prxplo.oprtnl_flag = 'A'
AND prxplo.pa_prvdr_type_lkpcd = 'RR'),
NULL, (SELECT prxplo.prvdr_lctn_idntfr
FROM pa_request_x_provider_location prxplo
WHERE prxplo.pa_rqst_sid = req.pa_rqst_sid
AND prxplo.oprtnl_flag = 'A'
AND prxplo.pa_prvdr_type_lkpcd = 'RR'),
(SELECT DISTINCT pd.national_prvdr_idntfr
FROM pa_request_x_provider_location prxplo
WHERE prxplo.pa_rqst_sid =
req.pa_rqst_sid
AND prxplo.oprtnl_flag = 'A'
AND prxplo.pa_prvdr_type_lkpcd = 'RR')
) AS "NPI/ID",
DECODE
((SELECT pd.org_bsns_name
FROM pa_request_x_provider_location prxplo
WHERE prxplo.pa_rqst_sid = req.pa_rqst_sid
AND prxplo.oprtnl_flag = 'A'
AND prxplo.pa_prvdr_type_lkpcd = 'RR'),
NULL, (SELECT pd.last_name
|| ', '
|| pd.first_name
|| ' '
|| pd.middle_name
FROM pa_request_x_provider_location prxplo
WHERE prxplo.pa_rqst_sid = req.pa_rqst_sid
AND prxplo.oprtnl_flag = 'A'
AND prxplo.pa_prvdr_type_lkpcd = 'RR'),
(SELECT pd.org_bsns_name
FROM pa_request_x_provider_location prxplo
WHERE prxplo.pa_rqst_sid = req.pa_rqst_sid
AND prxplo.oprtnl_flag = 'A'
AND prxplo.pa_prvdr_type_lkpcd = 'RR')
) AS "Prvdr Name",
TO_CHAR (psd.from_date,
'MM/dd/yyyy'
) AS "Srvc From Date",
TO_CHAR (req.validity_start_date,
'MM/DD/YYYY'
) AS "Due Date",
(fn_get_busniess_days (TRUNC (req.validity_start_date))
) AS "Days<br>Left",
req.pa_mode_type_lkpcd AS "Source",
TO_CHAR (TRUNC (wmdtl.rtng_date),
'MM/dd/yyyy'
) AS "Assigned On",
NVL (wmdtl.assigned_to_user_name,
'Not Assigned'
) AS "Assigned To",
req.org_unit_sid AS "OrgUnitSid",
TO_CHAR
(wmdtl.modified_date,
'MM/dd/yyyy hh24:mi:ss'
) AS "WTRD_MODIFIED_DATE",
TO_CHAR (wmdtl.rtng_date,
'MM/dd/yyyy'
) AS "WTRD_RTNG_DATE",
req.status_cid AS "PA_STATUS_CID",
TO_CHAR (req.modified_date,
'MM/dd/yyyy'
) AS "PA_REQ_MODIFIED_DATE",
prs.state_pa_srvc_type_code
AS "STATE_PA_SRVC_TYPE_CODE",
wmdtl.wm_pa_task_rtng_dtl_sid
AS "WM_TASK_RTNG_DTL_SID",
wmdtl.assigned_to_user_acct_sid
AS "WTRD_Assigned_to_user_acct_sid",
(fn_get_busniess_days (TRUNC (req.validity_start_date))
) AS "Days<br>LeftSort",
wmdtl.assigned_to_org_unit_sid
AS "WTRD_Assigned_to_OrgUntSid",
DECODE
((SELECT COUNT (*)
FROM pa_request_status prs
WHERE prs.pa_rqst_sid = req.pa_rqst_sid
AND prs.status_cid = 5
AND prs.oprtnl_flag = 'I'),
0, 'N',
'Y'
) AS "SHOW_UTILIZATION"
FROM pa_request req,
pa_certification_identifier pci,
status sts,
pa_request_x_member prxm,
wm_pa_task_routing_detail wmdtl,
pa_service_date psd,
org_unit ou,
pa_request_service prs,
pa_request_x_provider_location prxpl,
provider_location pl,
provider_detail pd,
provider p,
mbr_dmgrphc md
WHERE req.oprtnl_flag = 'A'
AND req.status_cid NOT IN
(20, 30, 70, 25, 80, 96, 85, 5, 97, 98, 101)
AND req.org_unit_sid IN
(3057, 3142, 3058, 3143, 3059, 3144, 3060, 3145,
3061, 3146, 3062, 3147, 3063, 3148, 3064, 3149,
3065, 3150, 3066, 3151, 3067, 3152, 3068, 3153,
3069, 3154, 3070, 3155, 3071, 3156, 3072, 3157,
3073, 3158, 3074, 3159, 3075, 3160, 3076, 3161,
3077, 3162, 3078, 3163, 3079, 3164, 3080, 3165,
3081, 3166, 3082, 3167, 3083, 3168, 3084, 3169,
3085, 3170, 3086, 3171, 3087, 3172, 3088, 3173,
3089, 3174, 3090, 3175, 3091, 3176, 3092, 3177,
3093, 3178, 3094, 3179, 3095, 3180, 3096, 3181,
3097, 3182, 3098, 3183, 3099, 3184, 3100, 3185,
3101, 3186, 3102, 3187, 3103, 3003, 75000104,
75000108, 2006, 75000103, 75000102, 75000113,
75000111, 75000109, 2001, 2009, 75000105,
75000107, 2004, 2010, 2013, 2014, 2005, 2011,
75000112, 2002, 1001, 2012, 75000106, 2007,
75000101, 2003, 75000110, 2008, 3001, 3002, 3019,
3104, 3020, 3105, 3021, 3106, 3022, 3107, 3023,
3108, 3024, 3109, 3025, 3110, 3026, 3111, 3027,
3112, 3028, 3113, 3029, 3114, 3030, 3115, 3031,
3116, 3032, 3117, 3033, 3118, 3034, 3119, 3035,
3120, 3036, 3121, 3037, 3122, 3038, 3123, 3039,
3124, 3040, 3125, 3041, 3126, 3042, 3127, 3043,
3128, 3044, 3129, 3045, 3130, 3046, 3131, 3047,
3132, 3048, 3133, 3049, 3134, 3050, 3135, 3051,
3136, 3052, 3137, 3053, 3138, 3054, 3139, 3055,
3140, 3056, 3141)
AND req.pa_rqst_sid = prs.pa_rqst_sid
AND prs.oprtnl_flag = 'A'
AND prs.pa_rqst_srvc_sid = psd.pa_rqst_srvc_sid
AND psd.oprtnl_flag = 'A'
AND req.pa_rqst_sid = pci.pa_rqst_sid
AND pci.oprtnl_flag = 'A'
AND req.pa_rqst_sid = prxm.pa_rqst_sid
AND prxm.oprtnl_flag = 'A'
AND md.oprtnl_flag = 'A'
AND md.status_cid = 2
AND TRUNC (SYSDATE) BETWEEN md.from_date AND md.TO_DATE
AND prxm.mbr_sid = md.mbr_sid
AND ou.org_unit_sid = req.org_unit_sid
AND ou.oprtnl_flag = 'A'
AND req.pa_rqst_sid = prxpl.pa_rqst_sid
AND prxm.pa_rqst_sid = prxpl.pa_rqst_sid
AND pci.pa_rqst_sid = prxm.pa_rqst_sid
AND pci.pa_rqst_sid = wmdtl.subsystem_task_sid
AND pci.pa_rqst_sid = prxpl.pa_rqst_sid
AND prxpl.pa_prvdr_type_lkpcd = 'RR'
AND prxpl.oprtnl_flag = 'A'
AND req.status_cid = sts.status_cid
AND sts.status_type_cid = 3
AND sts.oprtnl_flag = 'A'
AND prxpl.prvdr_lctn_iid = pl.prvdr_lctn_iid
AND p.prvdr_sid = pd.prvdr_sid
AND p.prvdr_sid = pl.prvdr_sid
AND pd.oprtnl_flag = 'A'
AND pd.status_cid = 2
AND TRUNC (SYSDATE) BETWEEN pd.from_date AND pd.TO_DATE
AND wmdtl.subsystem_task_sid = req.pa_rqst_sid
AND wmdtl.subsystem_lkpcd = 'PA'
AND wmdtl.oprtnl_flag = 'A'
AND req.pa_rqst_date > (SYSDATE - 365)
ORDER BY TO_DATE ("Request Date", 'MM/dd/yyyy hh24:mi:ss') DESC,
"Beneficiary Name" ASC) a
WHERE ROWNUM < 102;regards,
P Prakash
Edited by: BluShadow on 17-May-2011 15:01
added {noformat}{noformat} tags around the code833560 wrote:
Can any one give me clue ,how to find out which sub query returns more than one row in the following query .This is why smaller, simpler queries are easier to work with than huge ones - when something like this goes wrong smaller queries are much eaiser to debug. Unfortunately using smaller, easier-to-work with queries is not always an option
Ganesh is right - you will have to dissect the big query bit by bit until you find the offending subquery. If there is another way I would like to find out about it too.
The easiest way to do this is probably to use block comments to isolate parts of the query bit by bit until you find the offending part. If you carefully examine the subqueries you might be able to figure out which one is returning multiple rows without commenting everything
Good luck! -
How to use 'BAPI_GOODSMVT_CREATE' for more then one row selected ???
Hi,
I am using bapi , BAPI_GOODSMVT_CREATE , my requirement is that first perform ALV display with check boxes & then user can selsct any number of rows & then on clicking execute button this bapi is triggered , now my ques is that if i am selecting rows one by one & executing , then am able to post data successfully, but if am selecting more then one row at a time then its giving me error
" exactly one serial no must be selected (instead of more then two / three ) ."
plz help me .
this is how i am filling data in BAPi & bapi call
FORM FILL_BAPIDATA .
wa_GOODSMVT_HEADER-PSTNG_DATE = sy-datum.
wa_GOODSMVT_HEADER-doc_DATE = sy-datum.
wa_goodsmvt_code-gm_code = c_gmcode.
LOOP AT it_final INTO wa_final.
wa_GOODSMVT_ITEM-MOVE_TYPE = c_movtype. " '313'.
wa_GOODSMVT_ITEM-material = WA_final-MATNR.
wa_GOODSMVT_ITEM-ENTRY_QNT = wa_final-verme.
wa_GOODSMVT_ITEM-plant = WA_final-WERKS. "'DB10'.
wa_GOODSMVT_ITEM-STGE_LOC = WA_final-LGORT.
wa_GOODSMVT_ITEM-BATCH = WA_final-CHARG.
wa_GOODSMVT_ITEM-BATCH = l_charg.
append wa_GOODSMVT_ITEM to IT_GOODSMVT_ITEM.
clear: wa_GOODSMVT_ITEM.
ENDLOOP.
LOOP AT it_final INTO wa_final.
wa_serialnumber-SERIALNO = wa_final-sernr.
APPEND wa_serialnumber to it_serialnumber.
CLEAR wa_serialnumber.
ENDLOOP.
LOOP AT it_position2 INTO wa_position2.
wa_serialnumber-MATDOC_ITM = wa_position2-wepos .
MODIFY it_serialnumber INDEX sy-tabix from wa_serialnumber TRANSPORTING MATDOC_ITM .
ENDLOOP.,
data: begin of mthead.
include structure bapi2017_gm_head_ret.
data: end of mthead.
CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
EXPORTING
GOODSMVT_HEADER = wa_GOODSMVT_HEADER
GOODSMVT_CODE = wa_GOODSMVT_CODE
IMPORTING
GOODSMVT_HEADRET = mthead
MATERIALDOCUMENT = w_MATERIALDOCUMENT
MATDOCUMENTYEAR = w_MATDOCUMENTYEAR
TABLES
GOODSMVT_ITEM = IT_GOODSMVT_ITEM
GOODSMVT_SERIALNUMBER = IT_SERIALNUMBER
RETURN = IT_RETURN
GOODSMVT_SERV_PART_DATA =
EXTENSIONIN =
APPEND w_MATERIALDOCUMENT to it_GOODSMVT1 .
IF sy-subrc = 0 .
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
*MESSAGE text-016 TYPE 'I'.
PERFORM msg_log .
ENDIF.Hi,
Did u check the serial numbers table before calling the BAPI. Might be the case tht same serial number is assigned for all items, in this case the goods movement may be possible with same serial number for all items.
Reagrds,
Aditya
Edited by: aditya on Aug 11, 2009 11:46 AM -
Query returns more than one row
hi all,
I am getting this error msg, single row query returns more than one row after i added this
(select FUNC_GET_COUNTY_NAME(CCNTY1)
FROM proposal ) CName,
and the error is righ here AND K.CONTID = Q.CONTID
can someone help me what to do to take care of this error msg.
SELECT DISTINCT Decode(trim(Min(J.ROUTE)),null,'Un known', Min(J.ROUTE)) rt, v.vendor vd, r.addrnum ad, v.vnamel vn,
TRIM (r.aaddr1 || decode(trim(r.aaddr2),null,'',' - ') || r.aaddr2) ad1,
p.billto, r.acity cy, r.astate st,r.azipcode zp,
(select FUNC_GET_COUNTY_NAME(CCNTY1)
FROM proposal ) CName,
substr(decode(trim(r.vasst1),null, 'N/A','000/000-0000?','N/A','000/000-0000','N/A', r.vasst1),1,12) fx,
substr(decode(trim(r.aphone),null, 'N/A','000/000-0000?','N/A', r.aphone),1,12)ph,
substr(l.letting,3,2)||'-'|| substr(l.letting,5,2)||'-'|| substr(l.letting,1,2)lt,
l.CALL cl, l.lcontid cid, q.cprojnum sp, q.cfacssup ds,q.ccnty1 cty
FROM VENDOR V, VENDADDR R, LETPROP L, PLANHOLD P,PROPOSAL Q, PROJECT J,PROPPROJ K
WHERE V.VENDOR = R.VENDOR
AND K.CONTID = Q.CONTID
AND K.PCN = J.PCN
AND L.LCONTID = K.CONTID
and l.lcontid = '060143'
AND P.VENDOR = V. VENDOR
AND L.LETTING = P.LETTING
AND L.CALL = P.CALL
AND R.ADDRNUM = P.BILLTO
group by V.VENDOR,R.ADDRNUM, V.VNAMEL, R.AADDR1, R.AADDR2,P.BILLTO,R.ACITY, R.ASTATE,
R.AZIPCODE,R.VASST1,R.APHONE,L.LETTING, L.CALL,L.LCONTID,Q.CPROJNUM,Q.CFACSSUP,Q.CCNTY1 ,CCNTY1
ORDER BY Q.CPROJNUM DESC(select FUNC_GET_COUNTY_NAME(CCNTY1)
FROM proposal ) CName,You have no where clause.
But you might not need a select statement at all. Instead of a scalar subquery, can you just call the function:
,FUNC_GET_COUNTY_NAME(CCNTY1) -
ORA-01427: single-row subquery returns more than one row
I have a problem something like this:
table A
id col1 after_update
1 ? 11
2 ? 22
3 ? 33
3 ? 44
3 ? 55
4 ? 66
5 ? 88
5 ? ? /* won't be updated */
6 ? 99
7 ? null /* updated to null */
9 ? 20
table B
id col2
1 11
2 22
3 33
3 44
3 55
4 66
4 77
5 88
6 99
8 10
9 20
When I try the query:
update table A
set col1 = (select distinct col2 from table B) it gives me the error ORA-01427: single-row subquery returns more than one row
When I try the query:
update (select x.col1 x_col1,y.col2 y_col2
from (select id,col1,row_number() over (partition by id order by null /*col1*/) rn
from table_a
) x,
(select id,col2,row_number() over (partition by id order by col2) rn
from table_b
) y
where x.id = y.id
and x.rn = y.rn
set x_col1 = y_col2
it gives me an error saying ora-01779 :cannot modify a column which maps to a non key- preserved table. It shows the same even when I add the key to the tables.
My Database version is Oracle Database 11g Enterprise Edition Release 11.2.0.1.0
Kindly help.Another way, not waterproof too relay on rowid, but in your case it could work.
You have to verify it by yourself
update test_a aa
set col1 =
(select b.col1 from
(select
id, col1
,row_number() over
(partition by id order by col1) rn
from table_b) b,
( select
rowid, id, col1
,row_number() over (partition by id order by col1) sort_order
from test_a
) a
where
a.id=b.id
and
sort_order = rn
and
aa.rowid=a.rowid
)Edited by: chris227 on 03.04.2013 06:42
Table name corrected -
ORA-01427: single-row subquery returns more than one row HELP
I need to update baemployee.Stock_nbr field with select substr(C.CHECK_DIGIT, 3, 10)
from EMP_CHECK_DIG c where C.EMPLOYEE = e.EMPLOYEE
Please help.
update baemployee e
set Stock_nbr = (select substr(C.CHECK_DIGIT, 3, 10)
from EMP_CHECK_DIG c where C.EMPLOYEE = e.EMPLOYEE)
where exists
(select C.CHECK_DIGIT
from EMP_CHECK_DIG c where C.EMPLOYEE = e.EMPLOYEE)
and exists (select 1 from EMPLOYEE ee where ee.employee = e.employee and ee.emp_status like 'A%');
ORA-01427: single-row subquery returns more than one rowHi,
Welcome to the forum!
Whenever you have a question, please post some sample data, so that people can re-create the problem and test their solutions.
CREATE TABLE and INSERT statements, like the ones below, are great:
CREATE TABLE baemployee
( employee NUMBER (4)
, stock_nbr VARCHAR2 (10)
INSERT INTO baemployee (employee, stock_nbr) VALUES (1234, 'FUBAR');
CREATE TABLE employee
( employee NUMBER (4)
, emp_status VARCHAR2 (10)
INSERT INTO employee (employee, emp_status) VALUES (1234, 'ACTIVE');CREATE TABLE AS is good, too:
CREATE TABLE emp_check_dig
AS SELECT 1234 AS employee, 'AA1234567890ZZZ' AS check_digit FROM dual
UNION ALL SELECT 1234, 'AA2121212121ZZZ' FROM dual
;Also post the results you want from that data. In this case, the results would be the contents of the baemployee table after you run the UPDATE.
Would you want:
employee stock_nbr
1234 1234567890or would you want
employee stock_nbr
1234 2121212121If you run the UPDATE statement you posted with the data above, you'll get the "ORA-01427: single-row subquery returns more than one row" error, and you can see what causes it: there is more than one row from emp_check_dig that could be used to UPDATE the same row of baemployee. Say what you want to do in this situation (and why), and someone will help you find a way to do it. -
Update gives "single-row subquery returns more than one row"
Hi,
I have to update a table by getting values from two other tables. While doing that the inner query returns more than one value. I am not sure how to implement the logic without returning more than one row in sub quesry. Need help on that.
My query:
update buf_office_str o
set o.manager_ident =
(select sp.ident
from se2_r_src_sourceperson sp ,
(select distinct director_name, team_name from buf_sales_dump )t
where SP.SRCNAME = upper(substr(t.director_name,instr(t.director_name,' ')+1,length(t.director_name))||', '||substr(t.director_name,1,instr(t.director_name,' ')-1 ) )
and o.office_descr = t.team_name
Basically the query gets teh manager id from sp table where sp.srcname = t.team-name.
The office descr should be equal to the team_name.
This is the logic I am working towards:
For each office, i get the office_descr and get corresponding team_name. Match the team's director_name (from table t) with the sp.name and return the employee's id (sp.ident) for that office_descr.
I need to update all 50 offices with corresponding managerid for that office in buf_office_str table.
Is it possible to get done in one update? Pls let me know.Hi,
"Single-row subquery returns more than one row" is one of those error messages that actually means what it says: the correlated sub-query in your SET clause is sometimes returning 2 or more rows .
The solution could be as simple as making the sub-query SELECT DISTINCT , as its in-line view, t, already is.
It's possible you have bad data, or a mistake in your statement.
To find the problem cases, you can run something like this:
WITH sub_q AS
SELECT -- DISTINCT ?
sp.ident
, t.team_name
, COUNT (*) OVER (PARTITION BY t.team_name) AS cnt
FROM se2_r_src_sourceperson sp
, ( SELECT DISTINCT director_name
, team_name
FROM buf_sales_dump
) t
WHERE sp.srcname = UPPER ( SUBSTR ( t.director_name
, INSTR ( t.director_name
) + 1
, LENGTH (t.director_name)
|| ', '
|| SUBSTR ( t.director_name
, 1
, INSTR ( t.director_name
) - 1
SELECT o.* -- or whatever helps you
, sq.*
FROM buf_office_str o
JOIN sub_q sq ON o.office_descr = sq.team_name
WHERE sq.cnt > 1
;If you'd like more help, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all the tables as they exist before the UPDATE, and the results you want from that data (that is, the contents of buf_office_str after the UPDATE). Make sure the problem occurs with the sample data you post. -
Automated row fetch returns more than one row
Greetings All,
Does anyone know of a way to call a page if the automated row fetch returns more than one row. I have a form with a primary and secondary key. If I search only on the primary key and there is more than one row I would like to call a popup with the multiple list, is this possible?
Regards
MarkCreate a view on a table you want to update if you have more than two key values.
However, the automated row fetch does support two key values.
Denes Kubicek
http://deneskubicek.blogspot.com/
http://www.opal-consulting.de/training
http://htmldb.oracle.com/pls/otn/f?p=31517:1
------------------------------------------------------------------- -
Still problem with single-row subquery returns more than one row
//i did join each table but query runs forever and fail. looks Cartesian join so comes up the following SQL
the following query has a problem. would you please help me, please
Select pe.expense_id
,PE.CODE
,PE.PROJECT_ID
,PE.LDATE
,PE.INAMOUNT pe_amount
,(SELECT TRX.INV_AMOUNT FROM TRXEXPENSES TRX
WHERE PE.EXPENSE_ID=TRX.EXPENSE_ID) AS invamount
,(SELECT RE.AMOUNT FROM REEXPENSES RE WHERE
PE.EXPENSE_ID=RE.EXPENSE_ID) AS recogamount
,(SELECT MLE.M_AMOUNT FROM MATEXPENSES MLE
WHERE PE.EXPENSE_ID=MLE.EXPENSE_ID) AS matamount
from EXPENSES PE
where pe.expense_id=5600
group by expense_id,CODE,PROJECT_ID,LDATE,inamount
//get error message
ora-01427:single-row subquery returns more than one row
//check database
select expense_id,count(*) from TRXEXPENSES
where expense_id in(select expense_id from
expenses)
group by expense_id
having count(*)>1
//here is duplicate record a lot
EXPENSE_ID COUNT(*)
4176 2
5600 3
9572 2
9573 2
9574 2Yes, Expense_id has so many returning rows for trx.inv_amount from trxexpenses in subquery.
I want to show Expense_id with retruning rows using the above query.
ex)The result of the query is like that;
Expense_ Id project_id Ldate InvAmount RecogAmount MatAmount
5600 123 3/2/02 $100(InvAmount)
5600 432 3/12/02 $200(recogAmount)
5600 432 4/12/02 $250(MatAmount)
Thank you so much
Message was edited by:
user524064
Message was edited by:
user524064 -
Single-row query return more than one row
Hi all,
Whne i run the following command it is giving me the
The following error has occurred:
Details:
ORA-01427: single-row subquery returns more than one row
UPDATE MRCH.MRC_TEMP_PAY A
SET OFFSET_PH = (SELECT PHASE FROM MRCH.MRC_TEMP_PAY B
WHERE A.PROJECT_ID = B.PROJECT_ID
AND A.MUNI = B.MUNI
AND A.OFFSET = B.NEW_PAY)
WHERE A.PAY_IND = 'Y'
AND OFFSET IS NOT NULL;
any helpI tried max and min
they both give the duplicate row
1 SELECT A.PROJECT_ID,A.PINSUB,
A.MUNI,A.RATED_COST,
A.OLD_COST
FROM MRCH.MRC_TEMP_PAY A
2 WHERE OFFSET_PH = (SELECT max(PHASE) FROM MRCH.MRC_TEMP_PAY B
3 WHERE A.PROJECT_ID = B.PROJECT_ID
4 AND A.MUNI = B.MUNI
5 AND A.OFFSET = B.NEW_PAY
6 )
7 AND A.PAY_IND = 'Y'
8* AND OFFSET IS NOT NULL
SQL> /
PROJEC PIN MUNI RATED_COST OLD_COST
075395 221 070000 159435.45 1062300
175299 399 150000 312397.65 0
175299 399 170000 312397.65 0
SQL> ED
Wrote file afiedt.buf
1 SELECT A.PROJECT_ID,A.PINSUB,
A.MUNI,A.RATED_COST,
A.OLD_COST
FROM MRCH.MRC_TEMP_PAY A
2 WHERE OFFSET_PH = (SELECT mIN(PHASE) FROM MRCH.MRC_TEMP_PAY B
3 WHERE A.PROJECT_ID = B.PROJECT_ID
4 AND A.MUNI = B.MUNI
5 AND A.OFFSET = B.NEW_PAY
6 )
7 AND A.PAY_IND = 'Y'
8* AND OFFSET IS NOT NULL
SQL> /
PROJEC PIN MUNI RATED_COST OLD_COST
075395 221 070000 159435.45 1062300
175299 399 150000 312397.65 0
175299 399 170000 312397.65 0
175315 321 180000 167004.45 1113363
175320 321 130000 273639.45 1824263
Maybe you are looking for
-
PROBLEM WITH LOCALHOST SITE LOADING VERY SLOWLY (IF AT ALL) AFTER I UPGRADED FIREFOX TO 5.0 FROM 3.6 I have been successfully running MAMP, a personal Apache server with MySQL, on my MacBook Pro using OSX 10.6.4. This is so I can create a Wordpress b
-
Remove alert | Edit | Change type 0 We are on windows environment as below - Server - - Win2k8 Std R2, - SQL 2008, - SP 2010 Foundation SP2 Client - - Win 8.1 64 Bit OS, - Browser - IE 11 - MS Office - 2010 - 14.0.4763.1000 Problem - While Opening
-
Zen 2 GB & Creative Explorer problem
(Zen 2 GB & Creative Explorer problem` I wrote last fall about my Zen 2GB disconnecting in the middle of a transaction with Creative Media Explorer. My FM radio on that unit disappeared eventually, and the store I'd bought the Zen from exchanged it.
-
Job is failing with the following error- Error calling a method of the tree
dear SDNers, my question is where do i need to look for error. Will this be an ABAP issue? Please guide DETAILS In SM37 when we see the job XYZ, we get the following details. Job Ln Job CreatedB Status S
-
** Unable to see message interfaces in ID under Business Systems
Hi Friends, When I create sender / receiver agreement in ID by choosing the respective Business Systems I am not able to see my message interfaces. Then, I checked the SLD, our SWCV under Products are not assigned in the Business Systems. Then, I hav