Query displaying wrong results
Hi
I have developed a query, in dev and transported to quality.
everything worked fine in dev, after transport to quality, the query output is displaying data incorrectly
for one particular infoobject. value is fourtimes the original value in the cube.
Ex. cube has output for x field as 2.5
query has the output as 15.0. This behaviour is observed only in quality after transport.
Dev query is still working fine.
I think even retransport would not solve the issue, since Dev is fine.
Plz suggest,
Regards
Dear Sanju,
Iu2019m going to try helping you regarding your question,
Something, when you usually transport a query, something lose a variable, or structure, or calculate key figure, or restrict key figure. I suggest you; check all of component of query in development and quality system, through BEx Query Designer.
Be sure, that the data that you try to display isnu2019t impact be reporting authorization.
Compare the date in InfoProviders in both system development and quality system, through Tcode LISTCUBE.
Try to execute the query through Tcode RSUDO for check some authorization behavior, see the log through Tcode RSECPROT.
I hope this suggestion can help you to answer your question,
Luis
Similar Messages
-
Below is the query thats giving me wrong results ...can anyone help me figure where i am going wrong :(
SQL> select count(*) from t where source='LP1.1';
COUNT(*)
69
SQL> select count(*) from tblspring where line_a='LP1.1';
COUNT(*)
233now when i join these two table ...the total counts exceeds the expected records that i want
SQL> select count(*) from t , tblspring where t.source=tblspring.line_a and t.source='LP1.1';
COUNT(*)
16077the thing is i want to filter only those records from table t where the column named - source is equal to the column named line_a from table tblspring from the query in table t i get 69 records ....
now when i match the it table tblspring with the condition
i want the number of records should be less than or equal to 69 but not more than 69
Edited by: Suhail Faraaz on Mar 5, 2011 7:31 AM -
Hi
Could anybody tell me why this query is giving the wrong result? The column 'Spend for Selected Period' is showing as far too much (ie exactly 11 times too much!!!) when totalling the 37 invoices involved
SELECT T0.[CardCode], T0.[CardName],T0.[MailCity] AS 'Town', T2.[SlpName] AS 'Rep',
SUM(T1.DocTotal - T1.VatSum) AS 'Spend for Selected Period', MAX(T3.CreateDate) AS 'Last Visit Date'
FROM OCRD T0 left JOIN OINV T1 ON T0.CardCode = T1.CardCode LEFT JOIN OSLP T2 ON T0.SlpCode = T2.SlpCode LEFT JOIN OSCL T3 ON T0.CardCode = T3.Customer
where T0.[CardCode] = 'wyk027/34' AND T1.DocDate BETWEEN '20090101' AND '20091231'
GROUP BY T0.[CardCode], T0.[CardName],T0.[MailCity], T2.[SlpName]
Thanks
SteveHi ,
It seems like it is duplicated by the number of service calls.
Try this one:
SELECT T0.CardCode, T0.CardName,T0.MailCity AS 'Town', T2.SlpName AS 'Rep',
SUM(T1.DocTotal - T1.VatSum) AS 'Spend for Selected Period', (select MAX(T3.CreateDate) from OSCL T3 where T0.CardCode = T3.Customer) AS 'Last Visit Date'
FROM OCRD T0 inner JOIN OINV T1 ON T0.CardCode = T1.CardCode inner JOIN OSLP T2 ON T0.SlpCode = T2.SlpCode
where T0.CardCode = '10001' AND T1.DocDate BETWEEN '20090101' AND '20091231'
GROUP BY T0.CardCode, T0.CardName,T0.MailCity, T2.SlpName
Best regards,
Maya -
Query returning wrong results - Help required.
Hi All,
I am having a query in which I have 10 records, 5 with stop time 1 and 5 with stop time 2.
I have a scenario in which, I need to calculate the maximum,minimum for the records
with stop time 1 and 2.
What I did is, I selected all the 10 records using for loop. Within the loop
I am trying to find the maximum and minimum. It is giving me wrong results.
Please help me. My code is follows
declare
v_p1_min_stop_tm number;
v_p1_max_stop_tm number;
v_p2_min_stop_tm number;
v_p2_max_stop_tm number;
begin
for i in(
select
stop_tm
from
sample_stop
where
map_nbr = 16645 and
stop_dt = '05-sep-08'
)loop
if i.stop_tm = 1 then
select
min(i.stop_tm),
max(i.stop_tm)
into
v_p1_min_stop_tm,
v_p1_max_stop_tm
from
dual;
elsif i.stop_tm = 2 then
select
min(i.stop_tm),
max(i.stop_tm)
into
v_p2_min_stop_tm,
v_p2_max_stop_tm
from
dual;
end if;
end loop;
dbms_output.put_line('minimum p1 stop time : '|| v_p1_min_stop_tm);
dbms_output.put_line('maximum p1 stop time : '|| v_p1_max_stop_tm);
dbms_output.put_line('minimum p2 stop time : '|| v_p2_min_stop_tm);
dbms_output.put_line('maximum p2 stop time : '|| v_p2_max_stop_tm);
end;
My o/p is :
Minimum P1 stop time : 523
Maximum P1 stop time : 523
Minimum P2 stop time : 719
Maximum P2 stop time : 719
Here how can I make the data as two sets, one set with stop time 1 and
other with stop time 2.
Regards
RaghuIf the data type of stop_tm is varchar then try following
declare
v_p1_min_stop_tm number;
v_p1_max_stop_tm number;
v_p2_min_stop_tm number;
v_p2_max_stop_tm number;
begin
for i in(select stop_tm from sample_stop
where
map_nbr = 16645 and
stop_dt = '05-sep-08'
)loop
if i.stop_tm = 1 then
select min(to_number(i.stop_tm)), max(to_number(i.stop_tm))
into v_p1_min_stop_tm,v_p1_max_stop_tm
from
dual;
elsif i.stop_tm = 2 then
select
min(to_number(i.stop_tm)), max(to_number(i.stop_tm))
into
v_p2_min_stop_tm,v_p2_max_stop_tm
from
dual;
end if;
end loop;
dbms_output.put_line('minimum p1 stop time : '|| v_p1_min_stop_tm);
dbms_output.put_line('maximum p1 stop time : '|| v_p1_max_stop_tm);
dbms_output.put_line('minimum p2 stop time : '|| v_p2_min_stop_tm);
dbms_output.put_line('maximum p2 stop time : '|| v_p2_max_stop_tm);
end;
/ Regards
Singh -
Content Search Web Part displaying wrong Results for anonymous Users.
HI Forum Group,
I am getting Wrong results for my content search web part. The requirement is to show the News Description for the selected news item.
I have a catalog site which stores News like
News1
News2
News3
as Items. and i have connected this catalog in publishing site which is anonymous. In the publishing site created one page "News.aspx"added search results webpart which shows all the news item. Added one page "Description.aspx" to show
description to show the selected news item.
When ever user selects any news from news.aspx page it will redirected to description.aspx with the selected item ID
The "Description.aspx" the search results page gets the data based on the URL by QueryString parameter as shown below
The problem is, if i multiple items to open in tabs all the items are showing the data same as the first selected item, though the article ID is different.
Thanks
SithenderHi,
Thank you for your feedback on how you were successful in resolving this issue.
Your solution will benefit many other users, and we really value having you as a Microsoft customer.
Have a nice day!
Best Regards,
Lisa Chen
TechNet Community Support
Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
[email protected] -
Query returning wrong result set
I am running the following query on 8.1.7 database. The query is
SELECT Y.*, TEVStatus.lEndStatusFlag ENDSTATUSFLAG
FROM
(SELECT ROWNUM RANK, X.* FROM (SELECT lExceptionID ID,
TEVException.sMonitorName MONNAME, sExcpStatus STATUS
FROM TEVException WHERE (TEVException.lExceptionID IN
(SELECT lExceptionID FROM TEVException WHERE
sUserName_AssignedTo = 'vadmin')) ORDER BY
TEVException.lExceptionID DESC) X)
Y, TEVStatus WHERE (Y.RANK > 0 AND Y.RANK < 0 + 51 + 1) AND
(STATUS = TEVStatus.sStatusName);
The result is
RANK ID MONNAME STATUS ENDSTATUSFLAG
51 29 Type09B Open 0
50 30 Type09A Open 0
49 31 Type09E Open 0
48 32 Type09F Open 0
47 33 Type09G Open 0
46 34 Type09I Open 0
45 35 Type09C Open 0
44 36 Type10A Open 0
43 37 Type04A Open 0
39 41 Type08A Open 0
38 42 Type08C Open 0
RANK ID MONNAME STATUS ENDSTATUSFLAG
37 43 Type10B Open 0
36 44 Type10E Open 0
35 45 Type10C Open 0
34 46 Type10F Open 0
33 47 Type10D Open 0
32 48 Type08B Open 0
31 49 Type04B Open 0
29 51 Type08D Open 0
28 52 Type11E Open 0
27 53 Type11A Open 0
26 54 Type11D Open 0
RANK ID MONNAME STATUS ENDSTATUSFLAG
25 55 Type11C Open 0
24 56 Type11B Open 0
23 57 Type12A Open 0
22 58 Type12B Open 0
21 59 Type12C Open 0
20 60 Type12E Open 0
19 61 Type12A Open 0
18 62 Type12B Open 0
17 63 Type12E Open 0
16 64 Type12C Open 0
15 65 Type12D Open 0
RANK ID MONNAME STATUS ENDSTATUSFLAG
14 66 Type12D Open 0
4 80 Type01A_Ravi Open 0
3 83 Type01A_Ravi Open 0
2 84 Type01A_Ravi Open 0
1 87 Type01A_Ravi Open 0
42 38 Type06E Closed 8500
41 39 Type06A Closed 8500
40 40 Type06B Closed 8500
30 50 Type06C Closed 8500
13 68 Type01A Closed 8500
12 69 Type01A Closed 8500
RANK ID MONNAME STATUS ENDSTATUSFLAG
11 70 Type01A Closed 8500
10 71 Type01A Closed 8500
9 72 Type01A Closed 8500
8 73 Type01A Closed 8500
7 75 Type01A Closed 8500
6 77 Type01A Closed 8500
5 78 Type01A Closed 8500
51 rows selected.
In the above result, the RANK is not sorted properly and I
expected ID in descending order. The table which I was querying
had only about 100 records. I ran the same query on a larger
record set and the result is fine. I get ID in descending order
which I was expecting.
Could someone please tell me whether any bug in this case or
something wrong in the queryHi...
Took a quick look at tour SQL and....
SELECT Y.*
, TEVStatus.lEndStatusFlag ENDSTATUSFLAG
FROM ( SELECT ROWNUM RANK
, X.*
FROM ( SELECT lExceptionID ID
, TEVException.sMonitorName MONNAME
, sExcpStatus STATUS
FROM TEVException
WHERE ( TEVException.lExceptionID IN
( SELECT lExceptionID
FROM TEVException
WHERE sUserName_AssignedTo
= 'vadmin'
ORDER BY TEVException.lExceptionID DESC
) X
) Y
, TEVStat us
WHERE ( Y.RANK > 0
AND
Y.RANK < 0 + 51 + 1
AND STATUS = TEVStatus.sStatusName ;
Should "FROM ( SELECT ROWNUM RANK" be "FROM ( SELECT ROWNUM,
RANK"?
RANK is a reserved word, an analytic function.
Is "ORDER BY TEVException.lExceptionID DESC" doing anything? I
would drop it..
Hope this helps. Good Luck. -
Hello.
I have a query with LEFT OUTER JOIN that I think returns invalid results. Here are the problem details:
CREATE TABLE DOGERR(
IdDog INTEGER,
SfPdg CHAR(1),
IdVpl INTEGER,
SfVpGot INTEGER,
SfZrr CHAR(1)
INSERT INTO DOGERR(IdDog, SfPdg, IdVpl, SfVpGot, SfZrr) VALUES (1, 'S', 1, 1, '7');
INSERT INTO DOGERR(IdDog, SfPdg, IdVpl, SfVpGot, SfZrr) VALUES (2, 'S', 1, 1, '7');
INSERT INTO DOGERR(IdDog, SfPdg, IdVpl, SfVpGot, SfZrr) VALUES (3, '$', 1, 2, 'C');
COMMIT;
CREATE UNIQUE INDEX DOGERR_PK ON DOGERR(IdDog);
And now the query:
SELECT D.IdDog, D.SfPdg, D.IdVpl, D.SfVpGot, D.SfZrr, T.IdVpl AS IdVplJoin, T.SfVpGot AS SfVpGotJoin, T.SfZrr AS SfZrrJoin
FROM DOGERR D
LEFT OUTER JOIN (SELECT * FROM DOGERR WHERE SfPdg = 'S' OR SfPdg = 'S') T ON
T.IdVpl = D.IdVpl AND T.SfVpGot = D.SfVpGot AND T.SfZrr = D.SfZrr
WHERE
D.IdDog = 3
AND D.SfVpGot = 2
AND D.SfZrr = 'C';
This query should (by my understanding) return only one row in wich the joined subquery columns should be NULL. And indeed query returns only one row on Oracle Database 10g Release 10.2.0.1.0 - Production and on Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production:
IDDOG = 3, SFPDG = "$", IDVPL = 1, SFVPGOT = 2, SFZRR = "C", IDVPLJOIN = NULL, SFVPGOTJOIN = NULL, SFZRRJOIN = NULL
But on Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production it returns TWO rows:
IDDOG = 3, SFPDG = "$", IDVPL = 1, SFVPGOT = 2, SFZRR = "C", IDVPLJOIN = 1, SFVPGOTJOIN = 1, SFZRRJOIN = "7"
IDDOG = 3, SFPDG = "$", IDVPL = 1, SFVPGOT = 2, SFZRR = "C", IDVPLJOIN = 1, SFVPGOTJOIN = 1, SFZRRJOIN = "7"
And now the interesting part: any of the following modified versions of query works even on Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production, although modifications should not modify the result set:
-- Removed unnecessary WHERE conditions
SELECT D.IdDog, D.SfPdg, D.IdVpl, D.SfVpGot, D.SfZrr, T.IdVpl AS IdVplJoin, T.SfVpGot AS SfVpGotJoin, T.SfZrr AS SfZrrJoin
FROM DOGERR D
LEFT OUTER JOIN (SELECT * FROM DOGERR WHERE SfPdg = 'S' OR SfPdg = 'S') T ON
T.IdVpl = D.IdVpl AND T.SfVpGot = D.SfVpGot AND T.SfZrr = D.SfZrr
WHERE
D.IdDog = 3;
-- Removed unnecessary OR condition in subquery
SELECT D.IdDog, D.SfPdg, D.IdVpl, D.SfVpGot, D.SfZrr, T.IdVpl AS IdVplJoin, T.SfVpGot AS SfVpGotJoin, T.SfZrr AS SfZrrJoin
FROM DOGERR D
LEFT OUTER JOIN (SELECT * FROM DOGERR WHERE SfPdg = 'S') T ON
T.IdVpl = D.IdVpl AND T.SfVpGot = D.SfVpGot AND T.SfZrr = D.SfZrr
WHERE
D.IdDog = 3
AND D.SfVpGot = 2
AND D.SfZrr = 'C';
-- Removed columns from joined subquery from SELECT part
SELECT D.IdDog, D.SfPdg, D.IdVpl, D.SfVpGot, D.SfZrr, T.IdVpl AS IdVplJoin, T.SfVpGot AS SfVpGotJoin
FROM DOGERR D
LEFT OUTER JOIN (SELECT * FROM DOGERR WHERE SfPdg = 'S' OR SfPdg = 'S') T ON
T.IdVpl = D.IdVpl AND T.SfVpGot = D.SfVpGot AND T.SfZrr = D.SfZrr
WHERE
D.IdDog = 3
AND D.SfVpGot = 2
AND D.SfZrr = 'C';
NOTE: the query itself is a little stupid but this is just to demonstrate the problem. We have faced this problem at a customer with our real-world query.
So, my question is: why different results ?
Thanks.
Davidhi,
welcome to the forum,
don't have a solution, but I thought I'd let you know that the first SQL statement only returns 1 row on 10gR2
SQL> SELECT D.IdDog, D.SfPdg, D.IdVpl, D.SfVpGot, D.SfZrr, T.IdVpl AS IdVplJoin, T.SfVpGot AS SfVpGo
tJoin, T.SfZrr AS SfZrrJoin
2 FROM DOGERR D
3 LEFT OUTER JOIN (SELECT * FROM DOGERR WHERE SfPdg = 'S' OR SfPdg = 'S') T ON
4 T.IdVpl = D.IdVpl AND T.SfVpGot = D.SfVpGot AND T.SfZrr = D.SfZrr
5 WHERE
6 D.IdDog = 3
7 AND D.SfVpGot = 2
8 AND D.SfZrr = 'C';
IDDOG S IDVPL SFVPGOT S IDVPLJOIN SFVPGOTJOIN S
3 $ 1 2 C
SQL> select * from v$version;
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 - Production
CORE 10.2.0.4.0 Production
TNS for Solaris: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production -
Simple query returns wrong results in Sql 2012
On my Windows 8 box running Sql 2012 11.0.3128, this query returns an IncludeCount of 0 and an ExcludeCount of 1.
On my Windows 7 box running Sql 2008 10.50.2550 this query returns an IncludeCount of 3 and an ExcludeCount of 1, which is correct.
In short, it runs properly on these versions of OS and Sql's:
Windows 2008 R2 + Sql 10.50.2550
Windows 2008 R2 + Sql 10.50.4000
Windows 2012 SP1 + Sql 11.0.3000
Windows 7 + Sql 11.0.2100
And gives incorrect results on these OS's and Sql's (so far, tested):
Windows 8 Enterprise + Sql 11.0.3128
Windows 2008 R2 + Sql 10.50.2550
I wondered if anyone else can reproduce this? I can't figure out the magic combination of OS and SQL version this breaks on.
In all scenarios, the resulting @filters table is populated correctly, and the [Include] column is properly set to a 1 or a 0, so why aren't the other variables being properly set?
If I change the [ID] column to NONCLUSTERED, it works fine, too. It doesn't matter if @filters is a TVP or a temp table or an actual table, same (incorrect) results in each case.
DECLARE @filters TABLE([ID] bigint PRIMARY KEY, [Include] bit)
DECLARE @excludecount int = 0
DECLARE @includecount int = 0
DECLARE @id bigint
INSERT INTO @filters ([ID])
VALUES (1), (3), (4), (-7)
UPDATE @filters SET
@id = [ID],
@includecount = @includecount + (CASE WHEN @id > 0 THEN 1 ELSE 0 END),
@excludecount = @excludecount + (CASE WHEN @id < 0 THEN 1 ELSE 0 END),
[Include] = CASE WHEN @id > 0 THEN 1 ELSE 0 END,
[ID] = ABS(@id)
SELECT @includecount as IncludeCount, @excludecount as ExcludeCount
SELECT * FROM @filtersWhat part is undocumented?
http://technet.microsoft.com/en-us/library/ms177523.aspx
The above link states I can update variables inside an UPDATE statement ...
But it does not say what the correct result of what you are trying to would be. Variable assignment in UPDATE only makes sense if the UPDATE hits one row. If the UPDATE matches several rows, which value you the variable is set to is not defined.
It gets even more complicated when you have the variable on both sides of the expression. But I'd say that the only two values that makes as the final value of @includecount 0. An UPDATE statement, like other DML statements in SQL, is logically defined
as all-at-once. There are no intermediate results. Therefore the only possible values are the initial value of @includecount plus the value of the CASE statement, which always should returns 0, since @id is NULL when the UPDATE statement starts to execute.
I'm afraid that what you have is nonsense from a language perspective, and the result is undefined. Whenever you get different results from a query depending on whether you have certain indexes in place, you know that the query is indeterministic. There
are certainly part of SQL that are indeterministic, for instance ORDER BY on a non-unique columns. But in this particular case you have also wandered out into the land that is also undefined.
I'm not sure what you are trying to achieve, but I can only advice you to go back to the drawing board.
Erland Sommarskog, SQL Server MVP, [email protected] -
Hello
I need to derive result as mentioned below. In case of time range overlap, minimum of start time and maximum of end time should retrived.
day start_time end_time
sun 6:00 6:15
sun 6:30 6:45
sun 6:45 7:00
sun 7:00 7:15
mon 6:00 6:15
mon 7:00 8:00
o/p
day start_time end_time
sun 6:00 6:15
sun 6:30 7:15
mon 6:00 6:15
mon 7:00 8:00
We have tried with below query
SELECT DISTINCT ctry_code emp_nbr, day, start_time,
end_time,
(case when end_time = (LEAD (start_time) OVER (PARTITION BY ctry_code, emp_nbr, day ORDER BY ctry_code,
emp_nbr,
day,
start_time
)) then
'N'
else
'Y'
end) take_not
FROM sales_man
WHERE emp_nbr = 230
ORDER BY day, start_time
From above query we have found below result which is incorrect.
day start_time end_time
sun 6:00 6:30
sun 6:45 7:00
sun 7:00 7:15
mon 6:00 6:15
mon 7:00 8:00Please help on this
Thanks in advanceLike this perhaps?
SQL> ed
Wrote file afiedt.buf
1 with t as (select 'sun' as day, '6:00' as start_time, '6:15' as end_time from dual union all
2 select 'sun', '6:30', '6:45' from dual union all
3 select 'sun', '6:45', '7:00' from dual union all
4 select 'sun', '7:00', '7:15' from dual union all
5 select 'mon', '6:00', '6:15' from dual union all
6 select 'mon', '7:00', '8:00' from dual)
7 --
8 -- end of test data
9 --
10 select day
11 ,max(decode(tm,1,time)) as start_time
12 ,max(decode(tm,2,time)) as end_time
13 from (
14 select day, time
15 ,round((row_number() over (partition by day order by to_date(lpad(time,5,'0'),'hh24:mi'))+0.5)/2) as rn
16 ,2-mod(row_number() over (partition by day order by to_date(lpad(time,5,'0'),'hh24:mi')),2) as tm
17 from (
18 select day, decode(rn,1,start_time,end_time) as time
19 from t cross join (select rownum rn from dual connect by rownum <= 2)
20 group by day, decode(rn,1,start_time,end_time)
21 having count(*) = 1
22 )
23 )
24 group by day, rn
25* order by day, rn
SQL> /
DAY STAR END_
mon 6:00 6:15
mon 7:00 8:00
sun 6:00 6:15
sun 6:30 7:15
SQL>Obviously the ordering of the days in the result is based on the alphabetic name so "mon" comes before "sun", but you could change that easy enough like this...
SQL> ed
Wrote file afiedt.buf
1 with t as (select 'sun' as day, '6:00' as start_time, '6:15' as end_time from dual union all
2 select 'sun', '6:30', '6:45' from dual union all
3 select 'sun', '6:45', '7:00' from dual union all
4 select 'sun', '7:00', '7:15' from dual union all
5 select 'mon', '6:00', '6:15' from dual union all
6 select 'mon', '7:00', '8:00' from dual)
7 --
8 -- end of test data
9 --
10 select day
11 ,max(decode(tm,1,time)) as start_time
12 ,max(decode(tm,2,time)) as end_time
13 from (
14 select day, time
15 ,round((row_number() over (partition by day order by to_date(lpad(time,5,'0'),'hh24:mi'))+0.5)/2) as rn
16 ,2-mod(row_number() over (partition by day order by to_date(lpad(time,5,'0'),'hh24:mi')),2) as tm
17 from (
18 select day, decode(rn,1,start_time,end_time) as time
19 from t cross join (select rownum rn from dual connect by rownum <= 2)
20 group by day, decode(rn,1,start_time,end_time)
21 having count(*) = 1
22 )
23 )
24 group by day, rn
25 order by decode(day,'sun',1,'mon',2,'tue',3,'wed',4,'thu',5,'fri',6,'sat',7)
26* ,rn
SQL> /
DAY STAR END_
sun 6:00 6:15
sun 6:30 7:15
mon 6:00 6:15
mon 7:00 8:00 -
Union_all query returns wrong results
I have 6 individual queries that combine together using "union_all". If I run it, it returns 6084 records, see example 1.
Example 1:
sql1
union_all
sql2
unionl_all
sql3
sql6;
if I do it this way, example2, I get only 3821 records. Is there a bug in Oracle 11g? I select everything from 6084 records, I should get them all, correct?
Example 2:
select * from
sql1
union_all
sql2
unionl_all
sql3
sql6
note that I use "union_all" because the computer does not take it without the underscore.user557594 wrote:
Your queries do not deal with thousand of rows. My queries worked ok before the upgrade to 11g. I just want to know if there is a bug related to union all in 11g.If you believe that you are encountering a bug, you really should be posting this over on Metalink (My Oracle Support). When you do, you'll want to specify at a minimum the 4 digit Oracle version you are using (11g could mean either of two major releases and a few different patchsets).
I'm sure if you search My Oracle Support, you'll find at least one bug in whatever version of 11g you're using that occurs when UNION ALL is used (though I'll wager that you need two or three other conditions to be true as well). If you open a ticket, however, Oracle Support can determine whether you are actually encountering an error and/or whether you've encountered any of the published bugs, an unpublished bug, or a new bug. Once you know that, Oracle Support may or may not have a patch for you.
Unfortunately, if you can't post a test case that would allow us to reproduce the problem locally, it's going to be hard for us to provide much assistance. Of course, Oracle Support will also need a reproducible test case, but they can probably help you work through the process of putting one together complete with sample data and a query plan.
Justin -
MB5B & MMBE display wrong result in stock qty
Dear gurus,
I'm facing a problem in tcode MB5B & MMBE. there are one material (batch active), in MMBE there are stock exist but when i display in MB5B in open periode there are stock otherwise in end periode there no stock exist & there are no material document exist in MB5B. i'm also check in MB51 there are no exist history for the material.
Please for the advise.
Thanks a ton for repply.
ARAin MB5B i put start periode 01.01.2010 & end periode 29.09.2010...so after execute, in periode 01.01.2010 there are stock & in periode 29.09.2010 there are stock too (sorry in my 1'st explanation i told in end periode there no stock) but in detail section there are no material document exist which can explain from where the stock is from...so this behaviour is very strange is'nt it ?
-
Hei
I have created a query, but when I made extraction, the invoice number occur many times, but it should only occur 1 time. The summation of the value it is also many times.
How do I get the Query made so that the invoice and amount only appears 1 time, if there is only one piece.
I assume that it is some markings, I have not been properly plugged.
BillT Billing Type Bill.Doc. Rj reason for rej. Net Value Curr. BICat Billing category Doc. Date Profit Ctr
S1 Cancel Inv 94902955 3480,00 DKK L Del.related bil 10.06.2009 1832
S1 Cancel Inv 94902955 3480,00 DKK L Del.related bil 10.06.2009 1832
S1 Cancel Inv 94902955 3480,00 DKK L Del.related bil 10.06.2009 1832
S1 Cancel Inv 94902955 3480,00 DKK L Del.related bil 10.06.2009 1832
13920,00 DKK
I only need Bill.Doc and Net Value once.
Regards Lone
Edited by: Lone Holst on Aug 2, 2011 10:50 AMHi,
After you got the records/data in to the ITAB1.
assign ITAB1 to ITAB2.
sort: ITAB1, ITAB2 BY bill_doc.
delete adjaucent duplicates from ITAB2 comparing bill_doc.
loop at ITAB2.
loop at ITAB1 where bill_doc = ITAB2-BILL_DOC.
ITAB3-NET_VALUE = ITAB3-NET_VALUE + ITAB1-NETVALUE.
clear ITAB1.
endloop.
MOVE-CORRESPONDING ITAB1 to ITAB3.
append ITAB3.
clear: ITAB2, ITAB3.
ENDLOOP.
Ram. -
SQL Server 2012 Time(7) DataType values Comparison giving wrong result. Please help
We have a Table with StartTime and EndTime columns in Time(7) datatype, so we want to count the rows for each hour from 6 AM to 5 AM. If a record in table is as StartTime= 7 PM to EndTime = 5 AM (a shift of an employee) then the result is wrong beacause
being time(7) datatype the EndTime(5AM)< StartTime(7PM) in 24 hours format so following query gives wrong results.
select
* from EmpSchedule
where (StartTime>='19:00:00.0000000'
OR EndTime>='19:00:00.0000000')
Please help me out. ThanksDECLARE @clockIns TABLE (employeeID INT, startDateTime DATETIME, endDateTime DATETIME)
INSERT INTO @clockIns (employeeID, startDateTime, endDateTime)
VALUES
(1, '2014-07-01 19:01:00.000', '2014-07-02 04:27:00.000'),
(2, '2014-07-01 18:01:00.000', '2014-07-02 05:27:00.000'),
(3, '2014-07-01 19:01:00.000', '2014-07-02 05:27:00.000'),
(4, '2014-07-01 18:01:00.000', '2014-07-02 04:27:00.000')
SELECT *
FROM @clockIns
WHERE datepart(HOUR,startDateTime) BETWEEN 19 AND 23
OR datepart(HOUR,startDateTime) BETWEEN 0 AND 4
OR datepart(HOUR,endDateTime) BETWEEN 19 AND 23
OR datepart(HOUR,endDateTime) BETWEEN 0 AND 4
Try this out. -
Simple query with like return wrong result
Hi,
I run simple query with like.
If I use parameter I get wrong results.
If I use query without parameter results are ok.
My script:
ALTER SESSION SET NLS_SORT=BINARY_CI;
ALTER SESSION SET NLS_COMP=LINGUISTIC;
-- drop table abcd;
create table abcd (col1 varchar2(10));
INSERT INTO ABCD VALUES ('122222');
insert into abcd values ('111222');
SELECT * FROM ABCD WHERE COL1 LIKE :1; -- wrong result with value 12%
COL1
122222
*111222*
select * from abcd where col1 like '12%'; -- result ok
COL1
122222
I use Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
and query run in Oracle SQL Developer 3.1.07.Hi,
welcome to the forum.
When you put some code please enclose it between two lines starting with {noformat}{noformat}
i.e.:
{noformat}{noformat}
SELECT ...
{noformat}{noformat}
You should specify exactly how you run your code.
If I run this statement in SQL Plus:SQL> ALTER SESSION SET NLS_SORT=BINARY_CI;
Session altered.
SQL> ALTER SESSION SET NLS_COMP=LINGUISTIC;
Session altered.
SQL>
SQL> -- drop table abcd;
SQL> create table abcd (col1 varchar2(10));
Table created.
SQL>
SQL> INSERT INTO ABCD VALUES ('122222');
1 row created.
SQL> insert into abcd values ('111222');
1 row created.
SQL>
SQL> SELECT * FROM ABCD WHERE COL1 LIKE :1;
SP2-0552: Bind variable "1" not declared.
SQL>
I got this error. So I wonder how you set value 12%
Please specify exactly how you run your test as we cannot reproduce your problem.
Regards.
Al -
Display a query with multiple results and a little addon :D
Hello everybody,
I wanna make a JSP page that displays multiple results from a query.
I wanna those results to appair in a table, a row each one, and also a little "square radio form buttton" that makes me select rows I wanna delete (with another button at the end)
any idea?
Better if you post the code, I'm not a good JSP writer
thanks everybody for your attention and your time
Kind regardsYou're right.. I'd post nothing..
But it's all still in progress and I don't know what to post..
I understand is really difficult to invent some code without an origin (variables, functions, the bean), but also some general info would be really appreciated,also making a streched example if you can..
REQUESTS:
1) I need make a new JSP page, where will be visualize rows returned from a precise query selection
2)I use Beans, and my idea was to create Bean in JSP, open connection, make the query and create "some kind of FOR cycle" that fills a table, row by row
3)Every row must got a little "radio button" for a delete selection; the delete function will start when I press a specific button in this page(i'll use a servlet for this function)
4)The biggest and important trouble is HOW to display multiple rows in the Table
Maybe you are looking for
-
I cannot install iTunes 10.6
Currently, I use iTunes 10.1.2 with OS 10.5.8. I want to use my new iPad with the computer but I need to install at least iTunes 10.5 to do so. I cannot find any download source for 10.5 and my attempts to download the latest iTunes, 10.6, from the A
-
Please help with an embedded query (INSERT RETURNING BULK COLLECT INTO)
I am trying to write a query inside the C# code where I would insert values into a table in bulk using bind variables. But I also I would like to receive a bulk collection of generated sequence number IDs for the REQUEST_ID. I am trying to use RETURN
-
TS1702 How to retrieve calendar events
I lost all my past events on my phone - is there a way to retrieve them?
-
Handling two blocks in a canvas
I have two block namely "emp" and "dept" and I want to execute query in each block on a single button click. when the cursor is in "emp" table then the "emp" data should be display and vice versa.
-
"Error at Open" sturts-config.xml File
Hi, I have totally âusing JDG and the JAGâ convert an oracle designer modules âthat uses the CDM Rule frameâ using the JHeadstart 10g under JDeveloper 10g. The generation was successful and there was no errors the runtime of the generated app