Help for designing query
Hi,
I have info cube with 3 char and 1 key fig.
3 char r
material
plant
calender day.
1 key fig
Quantity
query i req. is
Plant material quantity(60days from input date) quantity(input date).
i have created 2 variable
one input and other cust exit on calender day.
when i execute query system does not show date for quantity(60days from input date).
code in exit is as follow::
CASE I_VNAM.
WHEN 'ZVAR_VALUE'.
IF I_STEP = 2 .
CLEAR L_S_RANGE .
READ TABLE I_T_VAR_RANGE WITH KEY VNAM = 'ZDATE' INTO LOC_VAR_RANGE TRANSPORTING LOW .
W_DATE = LOC_VAR_RANGE-LOW.
60_DATE = W_DATE - 60.
W_DATE = W_DATE - 1.
L_S_RANGE-SIGN = 'I' .
L_S_RANGE-OPT = 'BT' .
L_S_RANGE-LOW = '20080201'. "60_DATE.
L_S_RANGE-HIGH = '20080411'. "W_DATE.
APPEND L_S_RANGE TO E_T_RANGE .
ENDIF .
where ZDATE is input date variable and ZVAR_VALUE i populate using exit.
regards,
/sachinkumar
Hi SachinKumar,
it should be possible to work with an offset to get the result. You just use the variable input date twice, the second time, you set the offset for this variable to -60 (60 days before the input date). You don't have to use an customer exit for this.
Hope this helps!
Regards,
Tim
Similar Messages
-
Please Help for the Query
Hi frds please help me for the below query.What I want to do is to pull out the data from below table :-
date ticker indicator
03/13/2008 3IINFOTECH -8
03/18/2008 3IINFOTECH -4
03/25/2008 3IINFOTECH -5
03/27/2008 3IINFOTECH -3
as such :-
date ticker indicator
03/13/2008 3IINFOTECH -8
03/25/2008 3IINFOTECH -5
03/27/2008 3IINFOTECH -3
Here I want to find the Trend i.e either asc or desc order from the lowest indicator.
In the above sample data -8, -4, -5, -3 out of which I want the asc order data -8, -5, -3 and exclude -4 data.Because the asc order -8, -5, -3 will not follow.
So I want the data
date ticker indicator
03/13/2008 3IINFOTECH -8
03/25/2008 3IINFOTECH -5
03/27/2008 3IINFOTECH -3SQL> CREATE TABLE BORRAME(FECHA DATE, INDICA VARCHAR2(100));
Tabla creada.
SQL> INSERT INTO BORRAME VALUES(TO_DATE('03/13/2008','MM/DD/YYYY'), '3IINFOTECH -8');
1 fila creada.
SQL> INSERT INTO BORRAME VALUES(TO_DATE('03/18/2008','MM/DD/YYYY'), '3IINFOTECH -4');
1 fila creada.
SQL> INSERT INTO BORRAME VALUES(TO_DATE('03/25/2008','MM/DD/YYYY'), '3IINFOTECH -5');
1 fila creada.
SQL> INSERT INTO BORRAME VALUES(TO_DATE('03/27/2008','MM/DD/YYYY'), '3IINFOTECH -3');
1 fila creada.
SQL> COMMIT;
Validación terminada.
SQL>
SQL> SELECT FECHA, INDICA
2 FROM BORRAME
3 WHERE SUBSTR(INDICA,INSTR(INDICA,'-',1)+1,LENGTH(INDICA)) <> '4'
4 ORDER BY SUBSTR(INDICA,INSTR(INDICA,'-',1)+1,LENGTH(INDICA)) DESC;
FECHA
INDICA
13/03/08
3IINFOTECH -8
25/03/08
3IINFOTECH -5
27/03/08
3IINFOTECH -3
-
Help for a query to add columns
Hi,
I need for a query where I should add each TableC value as an additional column.
Please suggest...
I have 3 tables (TableA, TableB, TableC). TableB stores TableA Id and TableC stores TableB Id
Considering Id of TableA.
Sample data
TableA :
ID NAME TABLENAME ETYPE
23 Name1 TABLE NAMEA Etype A
TableB :
ID A_ID RTYPE RNAME
26 23 RTYPEA RNAMEA
61 23 RTYPEB RNAMEB
TableC :
ID B_ID COMPNAME CONC
83 26 Comp Name AA 1.5
46 26 Comp Name BB 2.2
101 61 Comp Name CC 4.2
Scenario 1: AS PER ABOVE SAMPLE DATA Put each TableC value as an additional column.
For an Id in TableA(23) where TableB contains 2 records of A_ID (26, 61) and TableC contains 2 records for 26 and 1 record for 61.
Output required: Put each TABLEC value as an additional column
TableA.NAME TableA.ETYPE TableB.RTYPE TableC_1_COMPNAME TableC_1_CONC TableC_2_COMPNAME TableC_2_CONC
Name1 EtypeA RTypeA Comp Name AA 1.5 Comp Name BB 2.2 so on..
Name1 EtypeA RTypeB Comp Name CC 4.2 NULL NULL
Scenario 2: If Table C contains ONLY 1 row for each Id in TableB, output should be somewhat
Output:
TableA.NAME TableA.ETYPE TableB.RTYPE TableC_1_COMPNAME
TableC_1_CONCvalue value value value valueHi,
Welcome to the forum!
Do you want the data from TableC presented
(1) in one column, or
(2) in several columns (a different column of results for each row in the original TableC)?
(1) Is called String Aggregation and is easier than (2).
The best way to do this is with a user-defined aggregate function (STRAGG) which you can copy from asktom.
Ignoring TableA for now, you could get what you want by saying
SELECT b.rtype
, STRAGG ( c.compname
|| ' '
|| c.conc
) AS c_data
FROM TableB b
JOIN TableC c ON b.id = c.b_id
GROUP BY b.rtype;(2) Presenting N rows of TableC as it they were N columns of the same row is called a pivot. Search for "pivot" or "rows to columns" to find examples of how to do this.
The number of columns in a result set is hard-coded into the query. If you don't know ahead of time how many rows in TableC will match a row in TableB, you can:
(a) guess high (for example, hard-code 20 columns and let the ones that never contain a match be NULL) or,
(b) use Dynamic SQL to write a query for you, which has exactly as many columns as you need.
The two scripts below contain basic information on pivots.
This first script is similar to what you would do for case (a):
-- How to Pivot a Result Set (Display Rows as Columns)
-- For Oracle 10, and earlier
-- Actually, this works in any version of Oracle, but the
-- "SELECT ... PIVOT" feature introduced in Oracle 11
-- is better. (See Query 2, below.)
-- This example uses the scott.emp table.
-- Given a query that produces three rows for every department,
-- how can we show the same data in a query that has one row
-- per department, and three separate columns?
-- For example, the query below counts the number of employess
-- in each departent that have one of three given jobs:
PROMPT ========== 0. Simple COUNT ... GROUP BY ==========
SELECT deptno
, job
, COUNT (*) AS cnt
FROM scott.emp
WHERE job IN ('ANALYST', 'CLERK', 'MANAGER')
GROUP BY deptno
, job;
Output:
DEPTNO JOB CNT
20 CLERK 2
20 MANAGER 1
30 CLERK 1
30 MANAGER 1
10 CLERK 1
10 MANAGER 1
20 ANALYST 2
PROMPT ========== 1. Pivot ==========
SELECT deptno
, COUNT (CASE WHEN job = 'ANALYST' THEN 1 END) AS analyst_cnt
, COUNT (CASE WHEN job = 'CLERK' THEN 1 END) AS clerk_cnt
, COUNT (CASE WHEN job = 'MANAGER' THEN 1 END) AS manager_cnt
FROM scott.emp
WHERE job IN ('ANALYST', 'CLERK', 'MANAGER')
GROUP BY deptno;
-- Output:
DEPTNO ANALYST_CNT CLERK_CNT MANAGER_CNT
30 0 1 1
20 2 2 1
10 0 1 1
-- Explanation
(1) Decide what you want the output to look like.
(E.g. "I want a row for each department,
and columns for deptno, analyst_cnt, clerk_cnt and manager_cnt)
(2) Get a result set where every row identifies which row
and which column of the output will be affected.
In the example above, deptno identifies the row, and
job identifies the column.
Both deptno and job happened to be in the original table.
That is not always the case; sometimes you have to
compute new columns based on the original data.
(3) Use aggregate functions and CASE (or DECODE) to produce
the pivoted columns.
The CASE statement will pick
only the rows of raw data that belong in the column.
If each cell in the output corresponds to (at most)
one row of input, then you can use MIN or MAX as the
aggregate function.
If many rows of input can be reflected in a single cell
of output, then use SUM, COUNT, AVG, STRAGG, or some other
aggregate function.
GROUP BY the column that identifies rows.
PROMPT ========== 2. Oracle 11 PIVOT ==========
WITH e AS
( -- Begin sub-query e to SELECT columns for PIVOT
SELECT deptno
, job
FROM scott.emp
) -- End sub-query e to SELECT columns for PIVOT
SELECT *
FROM e
PIVOT ( COUNT (*)
FOR job IN ( 'ANALYST' AS analyst
, 'CLERK' AS clerk
, 'MANAGER' AS manager
NOTES ON ORACLE 11 PIVOT:
(1) You must use a sub-query to select the raw columns.
An in-line view (not shown) is an example of a sub-query.
(2) GROUP BY is implied for all columns not in the PIVOT clause.
(3) Column aliases are optional.
If "AS analyst" is omitted above, the column will be called 'ANALYST' (single-quotes included).
{code}
The second script, below, shows one way of doing a dynamic pivot in SQL*Plus:
{code}
How to Pivot a Table with a Dynamic Number of Columns
This works in any version of Oracle
The "SELECT ... PIVOT" feature introduced in Oracle 11
is much better for producing XML output.
Say you want to make a cross-tab output of
the scott.emp table.
Each row will represent a department.
There will be a separate column for each job.
Each cell will contain the number of employees in
a specific department having a specific job.
The exact same solution must work with any number
of departments and columns.
(Within reason: there's no guarantee this will work if you
want 2000 columns.)
Case 0 "Basic Pivot" shows how you might hard-code three
job types, which is exactly what you DON'T want to do.
Case 1 "Dynamic Pivot" shows how get the right results
dynamically, using SQL*Plus.
(This can be easily adapted to PL/SQL or other tools.)
PROMPT ========== 0. Basic Pivot ==========
SELECT deptno
, COUNT (CASE WHEN job = 'ANALYST' THEN 1 END) AS analyst_cnt
, COUNT (CASE WHEN job = 'CLERK' THEN 1 END) AS clerk_cnt
, COUNT (CASE WHEN job = 'MANAGER' THEN 1 END) AS manager_cnt
FROM scott.emp
WHERE job IN ('ANALYST', 'CLERK', 'MANAGER')
GROUP BY deptno
ORDER BY deptno
PROMPT ========== 1. Dynamic Pivot ==========
-- ***** Start of dynamic_pivot.sql *****
-- Suppress SQL*Plus features that interfere with raw output
SET FEEDBACK OFF
SET PAGESIZE 0
SPOOL p:\sql\cookbook\dynamic_pivot_subscript.sql
SELECT DISTINCT
', COUNT (CASE WHEN job = '''
|| job
|| ''' ' AS txt1
, 'THEN 1 END) AS '
|| job
|| '_CNT' AS txt2
FROM scott.emp
ORDER BY txt1;
SPOOL OFF
-- Restore SQL*Plus features suppressed earlier
SET FEEDBACK ON
SET PAGESIZE 50
SPOOL p:\sql\cookbook\dynamic_pivot.lst
SELECT deptno
@@dynamic_pivot_subscript
FROM scott.emp
GROUP BY deptno
ORDER BY deptno
SPOOL OFF
-- ***** End of dynamic_pivot.sql *****
EXPLANATION:
The basic pivot assumes you know the number of distinct jobs,
and the name of each one. If you do, then writing a pivot query
is simply a matter of writing the correct number of ", COUNT ... AS ..."\
lines, with the name entered in two places on each one. That is easily
done by a preliminary query, which uses SPOOL to write a sub-script
(called dynamic_pivot_subscript.sql in this example).
The main script invokes this sub-script at the proper point.
In practice, .SQL scripts usually contain one or more complete
statements, but there's nothing that says they have to.
This one contains just a fragment from the middle of a SELECT statement.
Before creating the sub-script, turn off SQL*Plus features that are
designed to help humans read the output (such as headings and
feedback messages like "7 rows selected.", since we do not want these
to appear in the sub-script.
Turn these features on again before running the main query.
{code} -
Hi,
I want to design query. Below are the required:
Existing Table :
Code Val1 Val2 Val3
A A11 - -
B - B22 -
C - - C33
Output required:
Code Col1 Col2
A A11 B22
B B22 C33
C C33 -
Can anyone help with the query?Why don't you normalize your data?
E.g.
DECLARE @Sample TABLE
Code CHAR(1) ,
Val1 CHAR(3) ,
Val2 CHAR(3) ,
Val3 CHAR(3)
INSERT INTO @Sample
VALUES ( 'A', 'A11', NULL, NULL ),
( 'B', NULL, 'B22', NULL ),
( 'C', NULL, NULL, 'C33' );
-- SQL Server 2012+
WITH Normalized
AS ( SELECT U.Code ,
U.Attribute ,
U.Value
FROM @Sample S UNPIVOT ( Value FOR Attribute IN ( Val1, Val2, Val3 ) ) U
SELECT N.Code ,
N.Value ,
LEAD(N.Value, 1, NULL) OVER ( ORDER BY N.Code ASC )
FROM Normalized N;
-- SQL Server 2008+
WITH Normalized
AS ( SELECT U.Code ,
U.Attribute ,
U.Value ,
ROW_NUMBER() OVER ( ORDER BY U.Code ) AS RN
FROM @Sample S UNPIVOT ( Value FOR Attribute IN ( Val1, Val2, Val3 ) ) U
SELECT L.Code ,
L.Value ,
R.Value
FROM Normalized L
LEFT JOIN Normalized R ON L.RN = R.RN - 1;
btw, post in future concise and complete examples. Include table DDL and sample data INSERT statements as runnable T-SQL scripts. -
Hi All....
Required help for one more query.
I have a table with data like this:
Cust_id Transaction_no
111 1
111 2
111 3
111 4
111 5
111 6
222 7
222 8
333 9
333 10
333 11
333 12
I wrote the following query :
select cust_id, ntile(3) over (order by cust_id) "Bucket" from trans_detls
The output is like this :
Cust_id Bucket
111 1
111 1
111 1
111 1
111 2
111 2
222 2
222 2
333 3
333 3
333 3
333 3
The problem is that I dont want the cust_id to overlap in buckets. That is one cust_id should be present in only one bucket.
Is this possible?
Thanks in advance.
AmeyaOr Something like..
SQL> select * from test;
ID NO
111 1
111 2
111 3
111 4
111 5
111 6
222 7
222 8
333 9
333 10
333 11
333 12
12 rows selected.
SQL> select id, ntile(3) over (order by rn) "Bucket"
2 from(
3 select id,row_number() over(partition by id order by no) rn
4 from test);
ID Bucket
111 1
222 1
333 1
111 1
222 2
333 2
111 2
333 2
111 3
333 3
111 3
111 3
12 rows selected. -
Hi all,
Could you tell me any tools for design report layout or other way to design? Beside Quick Viewer, SAP Query, Report Painter/Writer, they can't group data and very complex.
Thank you!Use transaction GR11 GR12 GR13 to create and change layout.
-
hello,
I have a question again. The tables for the query are "Patient" and "Station".
Station-Table:
s_id, station
Patient-Table:
p_id, name, s_id, gender
I want to know how many Patient are Male and Female for each Station. That means that the output should be:
Station Male Female
S1 12 10
S2 6 4I supposed the values in gender are 'M' for Male and 'F' for Female
select s.station, sum(decode(p.gender, 'M', 1, 0)) Male , sum(decode(p.gender, 'F', 1, 0)) Female
from station s, patient p
where s.s_id=p.s_id
group by s.station; -
Help for designing the same forms like Oracle form!!!
Hi everyone!
I am working for some projects and now I want to make a form like Oracle form, there are some features in Oracle form that I don't know how to do the same so I would like to ask someone here. Please help me to design form like the form I mention below. I mean when I open my form, it must be the same with Query Material after that I press Enter then it must be the same Material Workbench form. Please help me!!! Thanks in advanced.
Inventory => On-hand Availability => On-hand Quantity, it will display Query Material Form then Enter after that it will display Material Workbench.Hi, welcome to the forums. Please take a few minutes to reveiw the following:
<ul>
<li> Before posting on this forum please read
<li> 10 Commandments for the OTN Forums Member
<li> Announcement: Forums Etiquette / Reward Points
</ul>
If you follow these general guidelines, you will greatly increase your chances of getting a solution to your question in a shorter period of time. While your questions may make sense to you - when you post a question here, you have to remember that we do not have the same point of reference as you. You can't assume we will understand vague references like *"I want to make a form like Oracle form"*. I've seen so many different UI variations in Oracle Forms that a blanket statement like this has no meaning. The only thing that limits the funtionality of a Form is your imagination.
Perhaps, after reviewing the aforementioned articles, you could provide us with some basic information like your Oracle Forms version, Browser and version, OS and version and a more detailed description of the type of functionality you are trying to emulate. With this information, we (the Forum participants) will be better able to help you.
Regards,
Craig... -
About (not) getting help for Design Premium CS4 [very long post]
If what i've heard on numerous occasions is true, and I really hope it is, Adobe spends a lot time, energy, emotion and effort on their Customer support system. In an effort to provide a bit of insight "from the trenches" I've spent the last hour sifting through Adobe's website trying to find an email where I could send a bit of critique regarding the quality of Adobe's Tech Support and I've come to the conclusion that these forums are a paying customer's only outlet. As part of my job training, I take a lot of notes whenever anything gets done over the phone. This then is a full transcript of the arduous process I had to go through in order to try and fix the infamous "licence has expired" issue. I'm not necessarily looking for feedback, I just want somebody at Adobe to see this and realise how much money is being wasted on a very dysfunctional "Support Service".
Adobe tech support notes:
How can the ball be dropped to this extent?
Friday, April 2nd
10:00 Installed the suite on the office's new design computer after using the trial editions until they expired. None of the programs in the suite will run because the licence is "expired".
11:30 Not knowing if it might somehow be related to there being leftover files from the trial editions (which I didn't uninstall) I uninstall everything and install again.
13:10 I receive the same error message. Tech support principally led to a waste of a day due to the way that Adobe's databases seem to catalogue customers. According to Jay Lopez, our suite wasn't registered to my boss (Doc) it was registered to Ken Schoepp, who hasn't worked here in about 8 years, since he was one of the earlier names connected to this address. It took about 2 hours and 2 transfers to figure this out.
15:30 I finally get transferred to tech support.
15:51 TS answers.
It takes 2 hours to assess what the problem is and suggest that I should do a full uninstall and reinstall of the suite, regardless of the fact that I did that before calling TS. 2nd installation fails to solve the problem whereby the suite won't load up (as expected). I'm given some instructions as to what files to remove that may contain registration information and could possibly prevent the program from running. Tech support hangs up as their shift is soon over but they assure me that this thrid installation of the day should fix the problem. To speed up the installation I copy the files onto the HDD.
17:15 For some unknown reason, Setup.exe crashes crashes at about 65% of initialisation. That's right, the installer can't even run!
Tuesday, April 6th
8:37 Calling TS
8:45 Don answers
8:51 Get informed that I was somehow routed to CS instead of TS. The case id I provided requires solutions that he can't provide, Don will transfer the call to TS.
8:53 Jitesh gives me a new case id before putting me on hold as he reads the case file.
9:05 Informs me that since my call deals with an installation issue I need to be transferred to another department. In response to my comment that I've already been misrouted twice today Jitesh says he will contact the department personally in order to transfer me more quickly as I'm already in their service.
9:13 Just before hanging up Jitesh mentions that there are only 12 calls ahead of me in the queue.
9:19 Rohan Subba answers. After reading the file he asks if I would accept sharing my desktop in order for him to look at the root of the issue using Acrobat Pro Meeting.
9:26 With files installed, logging in to "adobesupport.na5.acrobat.com" as guest.
As things are not working as expected, Rohan places me on hold as he goes to look up solutions.
9:31 Back from checking resources, try them out, still don't have access to some files due to lack of permissions.
9:36 Comes back with instructions on how to setup the Windows7 super admin account which should give me full access to the locked out files.
9:42 Logged in as admin. More hair pulling as we try to configure the permissions properly.
10:02 File sharing finally works and he downloads the installation log files. As we attempt to change permissions to access other files I ask why it is has taken 13 hours of TS and 4 techs before someone suggests using Adobe Connect Pro Meeting since it seems like a great way to gain access to files. Rohan's answer: Due to the solution chain, TS had to try other options before going for the ACPM.
Over the next hour we try various things to get rid of the files that are blocking the re-installation of Premium Suite. I'm instructed to download the "Windows Installer Cleanup Utility" and "adobeCS3cleanscript" even though I'm running CS4. The trial versions I was using were also CS4. I'm assured that the CS3script works just fine for CS4 removal. It gets run with option 1, once, and twice with option 2, rebooting between each pass.
11:01 Realisation sets in. "I'm sorry, I cannot resolve this issue and I will escalate your call to Tier 2 TS". Initially he asks if Thursday is good for the follow-up call but I inform that I will not be there on that day and that I am the only one at the office who can handle these types of technical calls.
11:05 Comes back on the line and informs me that T2 TS will contact me on Friday.
Spent the remainder of the day reading online, chasing possible solutions. Found out about a hidden option 3 for Cleanscript, run it twice, still no improvement. Having been shown the location of the installation log I sift through it and research 1) where each of the offending registry key is, 2) how to change permissions to the offending keys so I can delete them. Thanks to google and other people who've had the same issues I'm having and followed by blogging about it.
In total, 22 registry keys blocked the installation. Because each key would cause the installer to lock up and quit It took 6 hours to run the installer 22 times until it crashed in order to find and eliminate each one. When they were all taken care of, only 4 Premium suite modules wouldn't install: Flash, Flash Player, Acrobat and Air.
Progress at last.
Thursday, April 8th
Mesum, a resolution specialist, calls work asking to speak to Doc about our case. According to him there is no mention of a contact person (me) or a date for a call back. When asked probing questions about these discrepencies Mesum says that seeing as how Adobe TS are trained to exacting standards and that note taking is a very important part of the job there is no way that this break down happened on their end. If the information my boss is referring to is "not in the file" then it MUST be false. The obvious answer, according to Mesum, is that whoever made the appointment with Adobe didn't take down good notes. As a T2 specialist he "...makes it a point to always return the call at the arranged time". I don't have the notes regarding everything that was said that day but from talking to Doc on the following day I gather that Mesum made other comments to bring into doubt the quality of Aararat's (the company I work for) training, their note taking skills and the quality of their employees. Not once did he take any hint of responsibility for the communication screw-up. Mesum will be calling me back on the Friday (as was originally written down in our file) and provides a new case id before hanging up.
Friday, April 9th
12:01 Mesum call and wastes no time in trying to resolve the issue. I inform of the progress I made yesterday (independently).
12:08 Error :2 shows up again. Instructs me to clear the temp folder, the cache and to verify that the print spooler service is enabled. It is.
12:21 While the system is rebooting, Mesum mentions that the "very detailed conversation" he had the previous day and asks if I have been briefed about it. I explain that I have been briefed (neglecting to mention that I am the one who made the appointment and took copious notes about all my TS conversations, including this one) and that I hoping to get this issue resolved once and for all. Mesum makes a grandstanding comment about how "he makes it a point to always return the call at the arranged time as these calls are very important and it is crucial that they get resolved". He then goes on about the lenghts Adobe has gone to in order to create a support chain to make sure that if an issue is unresolved on either end of the chain, that this lack of resolution can be tracked down.
Error:2 indicates that we are still having registry blockage issues. In response to my question whether there might be a full list of the registry keys that Adobe Premium suite injects during an installation Mesum responds that techs have been given very strict and specific instructions about tampering with the windows registry (which is odd considering 3 days prior a tech dove right into registry editing) he proposes that I instead uninstall Flash, Flash player and Adobe Air.
13:07 Since the uninstaller won't run for just the 3 modules, Mesum asks that I uninstall everything once again. I am then to only start by installing Acrobat first, and only Acrobat, before installing the rest of the suite. Because this process will take a long time and Mesum has other calls to make he leaves me to this numberless installation being fairly certain that this will solve the issue. He adds that such problems are very frequent with Acrobat. Should his proposed course of action not solve the issue I can type up a follow-up response by going to www.adobe.com/go/supportportal. I am to expect a follow-up call on Monday.
13:22 Because I was really not looking forward to going through another round of uninstalling and reinstalling, I attempt to run flash one last time prior to starting the cycle. Run into error:5
reboot
13:29 Error:5 again. Time to uninstall once more.
13:35 Error while uninstalling. Nothing to do but click continue and see how it goes.
13:53 Uninstall finished with problems, running it again. Adobe Sing is still showing as an installed component.
13:55 Uninstall with errors. Flash Plug-in will not uninstall. Running Uninstaller again.
13:59 Uninstaller fails again. Decide to go and manually delete files and folders inspecting each one by one.
Spent the rest of the afternoon going through the install logs like I did on April 6th, unlocking ownership and deleting corrupted keys one at a time.
18:08 The whole Suite finally installs except for Flash and Indesign.
18:47 After hunting down more keys, the installer completes with errors but at least all the programs are installed. Acrobat, Air, Flash plug-in are still not installed properly.
Monday, April 12th
8:20 Call tech support
While on hold I try to find my ticket on the support portal using the case id's I've been given. None of them show up on the system. Basically, I'm stuck to using phone support.
9:23 TS answers. Sanjay
9:28 After Sanjay has verified the case id, I provide him with an update to the file regarding what I've done since I hung up on Friday, describing the new issues.
9:34 Placed on hold
9:42 Comes back and explains that this issue will require more consultation with his seniors. To make sure that he looks up the right issue I repeat the exact problem I would like him to research. Three times he repeats the information back to me just a little differently. Finally on the 4th repetition of the problem I'd like addressed he "gets it" and thanks me for "providing that pertinent information".
What I don't understand is that I repeated the same information that he repeated back to me 4 times before he seemed to understand what his notes told him he should be researching. From the heaviness of his accent I suspect that their was a bit of language barrier here.
9:48 Places me on hold
9:59 Comes back with a possible solution.
10:08 As his solution requires me to delete files I don't have access to due to lack of permissions, his solution can't be applied. He places me on hold.
10:11 Comes back, with another possible solution.
10:17 Still not working. I ask how I can change administrator settings for specific files and he needs to go check articles again. Shouldn't this type of knowledge just come off the top of his head if he's in TS? Sanjay just walks away at this point, not asking to put me on hold nor placing the call on hold. I can hear conversations in the background the whole time.
10:24 Comes back, thanking for staying on hold (even though I wasn't). This time he asks me to look for specific adobe folders. I can't delete them because I'm supposedly not an administrator, even though I'm logged in using the enabled super-admin account. He tells me I need to type a very specific command at the command prompt to reset the admin account. I thought that's what he was going to research the last time he left so I ask what I have to type at the command line to do this. Sanjay doesn't and asks if he can put me on hold again. I politely and calmly answer that no, I don't want to be put on hold. Every time I've asked him a question he's had to go in order to talk to his seniors (as he calls them). If possible, why not escalate my call and put me in touch with one of these seniors or a manager in order to minimise the amount of time I will be placed on hold. He puts me on hold.
10:34 Ashima comes on the line. Unlike Sanjay, she sounds confident and authorative.
10:44 After discussing what I'm trying to do she informs that not being able to delete files and folders is a Windows issue, not an Adobe issue. Even after I mention that a previous tech had helped me solve a similar problem in the previous week and try to reason that since it's Adobe uninstaller that caused this issue she sticks to her claim that it's a Windows issue and that she cannot help me resolve the issue. I am to contact Microsoft tech support in order to get help with this issue.
12:17 Call Microsoft technical support
12:23 Jacqueline answers. I describe the problem I'm having with managing permissions in Windows 7 and that I've been told that I resetting the admin account should solve this problem. She seems to agree and asks for my Windows serial number before we can start working on the issue. Upon finding out that I have an OEM version of Windows, Jacqueline informs me that I have 2 options: look online or pay 59$ per call on credit card for support as free support is not provided to OEM licences since they are typically only installed by resellers and assumed to be serviced by them. Sadly, this is not my case.
12:31 Having repeated my options back to Jacqueline to make sure I understood her correctly I inform her that I will terminate the call since I will not be paying for paying and therefore will go online for help. She sounds surprised at how quickly I made my decision, wishes me good luck and the call is ended.
13:30 Started researching a solution. I find what I need to know and apply it, managing to reclaim ownership of the files and folders. Run the installer again and everything installs now except for the Acrobat, Air and Flash plug-in.
Tuesday, April 13
15:30 Since I haven't received a call back from Mesum I try to find our case information on the Adobe Support Portal. I figure that Mesum probably needed me to contact him prior to today in order to confirm whether the solution worked or not. Logging in with the email address we used to register our software and log our support calls is unsuccessful. Either the password is wrong or the email is not active. Seeing as we have 2 other office emails with which Adobe products have been registered over the years I log on with them to see if we have pending cases on either of them. negative. Just to test something out I attempt logging in to the original email from another computer. While I can't log in I no longer get the message that the email isn't related to an active customer account, just that the password is wrong. Resetting password. Still can't login.
16:06 Starting LiveChat with Adobe to see if they can help. On hold.
16:12 Connected. explain the situation.
16:19 Says the password is reset from their side. Try it and doesn't work.
16:22 I tell Live Chat the reset didn't work, and wait for response.
16:29 He assures me it's been reset and that I should try again.
16:30 Try it to connect via two other computers. Fail. Inform him again. Wait.
16:36 Informs me I will need to call Phone Support. I ask if he can connect me.
16:38 No, he cannot connect me. There is no Live Chat Tech Support. Due to the amount of lag between responses I ask if how many chat sessions he works on at the same time.
16:41 Answer: three at a time.
16:45 Finish typing comment and suggestion about possibly reducing that number because the amount of lag time for simple requests is just too much.
16:46 Final response and goodbye.
16:47 Call Phone Support
16:50 Jerry in the Philippines. I explain the issues I've been having with our account and the failure to reset the password. Jerry puts a note in the file and that he'll look into it.
16:58 Puts me on hold as he goes to explore.
17:01 Comes back, can't see any issues. Asks me for permission to logon to the client account by using our email and password. I accept. He logs on and sees that there are in fact no pending cases that show up in our client account, even though we have multiple concurrent case id's showing on his side. He says he'll look into it.
17:07 Client login issue is unresolved but at least I'm getting transferred to TS.
17:23 Panpaj answers. I explain the situation and provide case id.
17:38 He provides a new case id. I have to describe the whole case history.
17:46 On hold.
17:52 Turns out I was transferred to the Acrobat specific TS. Seeing as how my installation problems aren't dealing specifically with Acrobat he can't help me. He will transfer me to general TS.
18:16 Animesh answers. explain the situation and provide case id.
18:20 Puts me on hold as he reads the file.
18:22 Repeats the problem as described according to the file.
18:30 Puts me on hold as he goes to find articles.
18:36 Asks me to share the desktop. Connecting to connectteam.acrobat.com
18:44 Upload of log file complete, reading over it.
18:48 Sharing screen caps of installation error messages. I've been thoroughly documenting each and every single one. Instructs me to download and AdobeCS4cleanscript. When I explain that I've already used the CS3 version I'm informed that the CS3 version should never be used to try and clean up a CS4 installation since it won't work.
18:56 I'm informed that TS closes at 19:00 and that he won't be able to finish this call. However, if I read article kb 401401 I should find some steps that will solve the issues that I'm experiencing.
19:01 While looking for the article I inform him that I can't access my TS updates on the Support Portal and that in a previous call Phone Support was not able to explain why. Might he have any idea why? He says he'll check it out.
19:05 "That's odd. I'll add this complaint to the file."
Animesh adds that If this knowledge base article does not resolve the issue, I should make sure to call back. He's added a note in the file to automatically escalate my call to Tier3 TS.
"What? There's a T3?" I ask. "Why has it taken 2 weeks to get this call escalated to tier 3?"
He apologizes if this taken so long to be escalated but there are definite checks and procedures that need to be followed before a call can be escalated to Tier 3.
April 15th
11:10 Starting new uninstall of CS4
11:20 Uninstaller error with InDesign.
11:31 Running CS4cleanscript, all options.
11:49 Completed running CS4cleanscript followed by a manual clean-up of remaining folders. Starting a new install.
12:04 Install error with Flash 10 ActiveX.
12:06 Install error with Flash 10 plug-in.
12:37 Installer finished, with errors.
12:53 Test launched every application in the Suite and they seem to be working in spite of the errors. So be it, I'm never calling Adobe TS again.
Questions and suggestions to Adobe
In spite of not having my issue corrected I must say that the politeness of every representative was exemplary.
While I realise software piracy is a big issue, why is it that pirates don't struggle with your DRM system yet legal users do? Either scrap your current DRM and replace it with something that will not cripple a system if an installation goes wrong or change your installers.
Software suites are convenient yes but there are now so many modules that come bundled with the suite that seem utterly pointless because the documentation for them is sorely lacking an "at a glance" explanation of features, benefits and purpose. Adobe Air, Sing, Version Cue and Bridge come to mind. Don't you think cutting down on module bloat would make interoperability an easier thing to manage and maintain?
As a user who has multiple hard drives in his system (one each for the OS, applications and project data) I don't like installers that place files all over my system without my consent. If an installer asks for a destination folder, ALL programs should go into that folder. Files and programs that are shared across the suite for added functionality or registration purposes should ask for a user-specified shared folder (in case there is one) rather than just go into the (assumed) default.
Why is the Support DB's search function so useless? I've tried (and tried, and tried, and tried...) to find useful solution articles but something is just plain wrong with your search algorithms. I've tested this. Pick an article at random, then do a search for it's title. Too often the search engine won't even find it. The only time searches work is if one has the precise number of the article, such as KB 401401.
The amount of checks and procedures required for service escalation needs to be streamlined in order to speed up the process. It took too long to get to the right Tier. By the time I was finally escalated to Tier 3 your support services had eroded all of their credibility.
Practices and procedures (P&P) need to be more uniform. I have one tech telling me to use one version of clean script and claiming it's fine whereas another claims that only the CS4 script would work to resolve my issue. Why is this? What does this reveal about levels of training? There is also large gaps in the knowledge of individual representatives. As should be expected, some representatives knew exactly what to do and how to do it without having to resort to articles every 3 minutes. Others, such as Sanjay, either need to be retrained or let go. His lack of knowledge was thoroughly exasperating.
The case id system needs to be reworded. Over these 2 weeks I was given 4 case id's, none of which ended up showing up in the support portal for follow-up. Furthermore, note taking seems to be a problem because there was a lot of information that just never seemed to make it "in the file".
Why do calls get transferred to the wrong department so often?
In Closing
Due to having more pressing matters to attend to at work and seeing as how I could not afford to spend any more time fixing the harm that was brought on by carrying out the suggested "solutions" I have not called back since April 15th. The suite runs "with quirks" and will stay that way until I rebuild the system because it seems that the only solution that remains regarding the installation woes is to wipe the drive and start from scratch.
Thank you for reading this whole transcript. I hope it helps you improve your customer service experience.
Marc-Andre RenaudThank you for the sympathy and the information about the Adobe.com forum Michael.
I posted here because, to be honest, for a company that's acknowledged their installers and updaters and support needs some work, they seem very determined to obfuscate the means by which users can provide direct feedback to the company. Much like you, I've also noticed a trend in CS5 installations that mirrors the issues that were present in CS4. it's a sad state of affairs.
As for my installation, you are also quite right to say that a clean install would have been a lot faster than what I went through with TS and it was actually my first idea. Before calling TS I'd actually read through the forums and noticed that a large number of users who were faced with my situation had no other choice but to reformat. I was just giving Adobe the benefit of the doubt and wasted 2 and a half weeks through that course of action...
What makes this situation even more frustrating is that the installer failed on a fresh system. It was a custom-built design machine, assembled and configured by myself. The only software that had been installed on it prior to Design Premium was Firefox, an FTP client and the start of my problems, trial versions of various CS4 programs. I used trials just long enough to retire the previous design computer so that I wouldn't contravene the EULA's stipulation of not running more than one instance of software at the same time on different machines. Turns out being honest once again penalised a legal customer.
If there is just thing users should learn from my far from unique tale of failed tech support it's that if you ever run into a problem with the installation, don't bother calling TS, just reformat and start from scratch. It might seem like it'll take longer to get going again, but in actuality, it's the opposite. Reformatting means you'll be up and running in about 1 or 2 days rather than 2 weeks.
Marc -
Hi,
Oracle 10g r2.
I have a page with a listbox item, and a "cart" that can contains values from the listbox (user can add values from the listbox to the cart).
I want to filter a report depending on the values in the cart and the value selected in the listbox !
Only one value can be selected in the listbox, but the cart can contains several values.
When no value is selected in the listbox, it returns '%', else it returns the value
Here is what I need :
listbox = '%', cart = empty ==> return all records
listbox = '%', cart = 'value1, value2' ==> returns records where spat_area_name in ('value1','value2')
listbox = 'value1', cart = 'value2, value3' ==> return records where spat_area_name in ('value1','value2','value3')
listbox = 'value1', cart = empty ==> return records where spat_area_name in ('value1')
For example (don't works) :
select
from
spatial_points
where
spat_area_name like :p3_filtre_area_name
or
spat_area_name in (
select usa_area_name from user_selected_areas where usa_loggus_id = 591
):p3_filtre_area_name is the listbox value
(select usa_area_name from user_selected_areas where usa_loggus_id = 591) returns the values stored in the cart
I tried a few things (using CASE or DECODE) but I can't manage to make it works.
So any help would be much appreciated.
Thanks.
Yann.Hi,
Here are some create/insert statements if you want to test :
create table accelerator_lines (
accl_name varchar2(7),
accl_description varchar2(50),
constraint accl_lines_pk primary key (accl_name)
create table areas (
area_name varchar2(7),
area_description varchar2(50),
constraint areas_pk primary key (area_name)
create table spatial_points (
spat_id integer,
spat_accl_name varchar2(7),
spat_area_name varchar2(7) not null,
spat_class varchar2(6) not null,
spat_number varchar2(6) not null,
spat_pt varchar2(1),
spat_type varchar2(1) not null,
constraint spatial_pk primary key (spat_id),
constraint spat_type check (spat_type in ('P','S','B','T','U','C')),
constraint spat_pt check (spat_pt in ('E','S','A','B','C','D')),
constraint spatial_accl_fk foreign key (spat_accl_name) references accelerator_lines(accl_name),
constraint spatial_area_fk foreign key (spat_area_name) references areas(area_name)
create table user_selected_areas (
usa_id integer,
usa_area_name varchar2(7),
constraint usa_id_pk primary key (usa_id),
constraint usa_area_name_fk foreign key (usa_area_name) references areas(area_name)
create table user_selected_accl_lines (
usal_id integer,
usal_accl_name varchar2(7),
constraint usal_id_pk primary key (usal_id),
constraint usal_accl_name_fk foreign key (usal_accl_name) references accelerator_lines(accl_name)
insert into accelerator_lines values ('LHC','LHC description');
insert into accelerator_lines values ('LINAC4','LINAC4 description');
insert into accelerator_lines values ('SPS','SPS description');
insert into accelerator_lines values ('TI12','TI12 description');
insert into accelerator_lines values ('TI18','TI18 description');
insert into accelerator_lines values ('LEP','LEP description');
insert into areas values ('TT81','TT81 description');
insert into areas values ('PDV3','PDV3 description');
insert into areas values ('PDV4','PDV4 description');
insert into areas values ('193','193 description');
insert into areas values ('EHW1','EHW1 description');
insert into areas values ('TCC2','TCC2 description');
insert into spatial_points values (1,'LHC','PDV4','MB2M1','22586','E','A');
insert into spatial_points values (2,'LHC','PDV4','MB2M1','22586','S','A');
insert into spatial_points values (3,'LHC','PDV4','MBC4','sr555','E','B');
insert into spatial_points values (4,'TI12','TT81','RD433','22','E','A');
insert into spatial_points values (5,'TI12','TT81','ESD8C5','564','S','A');
insert into spatial_points values (6,'LEP','PDV3','MBRRM1','22586','E','B');
insert into spatial_points values (7,'LEP','PDV3','MBRRM1','22586','S','B');
insert into spatial_points values (8,'LEP','PDV3','FFZ55','2266','B','C');
insert into spatial_points values (9,'LEP','PDV3','YEFH8','18992','E','B');
insert into spatial_points values (10,'LEP','PDV4','YEFH8','18992','S','B');
insert into spatial_points values (11,'LEP','PDV4','YEFH8','18995','E','B');
insert into spatial_points values (12,'LEP','PDV4','YEFH8','18995','S','B');
insert into spatial_points values (13,'LEP','PDV4','YEFH8','18996','E','B');
insert into spatial_points values (14,'LEP','PDV4','YEFH8','18996','S','B');
insert into spatial_points values (15,'LEP','PDV4','YEFH8','18999','D','U');
insert into spatial_points values (16,'LINAC4','193','QASM1','4255','E','B');
insert into spatial_points values (17,'LINAC4','193','QASM1','4255','S','B');
insert into spatial_points values (18,'LINAC4','193','QASM1','4264','E','B');
insert into spatial_points values (19,'LINAC4','TCC2','FFEPO','4264','S','B');
insert into spatial_points values (20,'LINAC4','TCC2','QASM1','4255','D','P');
insert into spatial_points values (21,'SPS','EHW1','LMRDE','22586','E','B');
insert into spatial_points values (22,'SPS','EHW1','LMRDE','22586','S','B');
insert into spatial_points values (23,'SPS','EHW1','X8PE5','22587','E','B');
insert into spatial_points values (24,'SPS','EHW1','X8PE5','22587','S','B');
insert into spatial_points values (25,'SPS','EHW1','X8PE5','22590','C','A');
insert into spatial_points values (26,'SPS','TCC2','DDFFR9','22590','C','A');
insert into spatial_points values (27,'TI18','PDV4','94FFG4E','22586','E','B');
insert into spatial_points values (28,'TI18','PDV4','94FFG4E','22586','S','B');
insert into spatial_points values (29,'TI18','193','94FFG4E','22589','E','T');
insert into spatial_points values (30,'TI18','TCC2','NO55D','22589','S','T');
insert into user_selected_areas values (1,'PDV4');
insert into user_selected_areas values (2,'193');
insert into user_selected_accl_lines values (1,'TI18');Currently, my query is the following :
select
spat_id,
spat_accl_name,
spat_area_name,
spat_class,
spat_number,
spat_pt,
spat_type
from
spatial_points
where
spat_area_name like :p3_filtre_area_name
and spat_class like nvl(:p3_filtre_spatial_class,'%')
and spat_number like nvl(:p3_filtre_number,'%')
and instr(:p3_filtre_spatial_point_values,nvl(spat_pt,' ')) > 0
and instr(:p3_filtre_spatial_type_values,spat_type) > 0
and (
(:p3_filtre_accl_name is null and spat_accl_name is null)
or decode(:p3_filtre_accl_name,'%',nvl(spat_accl_name,'_null_'),:p3_filtre_accl_name) = nvl(spat_accl_name,'_null_')
)It works but it takes care only of the items values, but not of the values contained in the cart (USER_SELECTED_AREAS and USER_SELECTED_ACCL_LINES).
There will be a USER_SELECTED_ table for spat_class, spat_number, spat_pt, spat_type too.
:p3_filtre_area_name is a select list that contains AREAS table values
:p3_filtre_accl_name is a select list that contains ACCELERATOR_LINES table values (+ "_null_" value).
:p3_filtre_spatial_class and :p3_filtre_number are textfield items
:p3_filtre_spatial_point_values and :p3_filtre_spatial_type_values are textfiel items containing a comma seperated list of values (ie. "E,A,B,C").
select lists return '%' when nothing is selected
textfields return null when nothing is entered
I hope I'm understandable.
Thanks. -
Hi all..
I required some help in writing a query..
My table is like this
Cust_id Cust_type Del_status Incharge
111 Gold HD
222 Gold
333 Gold HD
444 Gold
123 Gold HD
456 Gold
789 Gold HD
987 Gold
555 Silver HD
666 Silver HD
777 Silver
888 Silver
I want a query to generate this output
Cust_id Cust_type Del_status Incharge
111 Gold HD 1
222 Gold 1
333 Gold HD 1
444 Gold 1
555 Silver HD 1
777 Silver 1
123 Gold HD 2
456 Gold 2
789 Gold HD 2
987 Gold 2
666 Silver HD 2
888 Silver 2
The query basically allocates the customers to incharges... based on cust_type and del_status.
there are 3 categories, Gold Customers, Silver Customers and HD customers..
It should divide this three equally amongst the 2 incharges...
Also this is just a sample data... actually table consists of around 3Lac customers and 12 incharges
Sorry if its a incorrect post..
Thanks in advance..Is there a way to find the value for ntile(2) dynamically?
I tried something like
Connected to:
Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.8.0 - Production
SQL> with mytable as (select 111 cust_id, 'Gold' cust_type, 'HD' del_status from dual UNION ALL
2 select 222 cust_id, 'Gold' cust_type, null del_status from dual UNION ALL
3 select 333 cust_id, 'Gold' cust_type, 'HD' del_status from dual UNION ALL
4 select 444 cust_id, 'Gold' cust_type, null del_status from dual UNION ALL
5 select 123 cust_id, 'Gold' cust_type, 'HD' del_status from dual UNION ALL
6 select 456 cust_id, 'Gold' cust_type, null del_status from dual UNION ALL
7 select 789 cust_id, 'Gold' cust_type, 'HD' del_status from dual UNION ALL
8 select 897 cust_id, 'Gold' cust_type, null del_status from dual UNION ALL
9 select 555 cust_id, 'Silver' cust_type, 'HD' del_status from dual UNION ALL
10 select 666 cust_id, 'Silver' cust_type, 'HD' del_status from dual UNION ALL
11 select 777 cust_id, 'Silver' cust_type, null del_status from dual UNION ALL
12 select 888 cust_id, 'Silver' cust_type, null del_status from dual UNION ALL
13 select 1001 cust_id, 'Copper' cust_type, null del_status from dual UNION ALL
14 select 1002 cust_id, 'Copper' cust_type, 'HD' del_status from dual UNION ALL
15 select 1003 cust_id, 'Copper' cust_type, null del_status from dual
16 )
17 select t1.cust_id
18 , t1.cust_type
19 , t1.del_status
20 --, ntile(3) over (partition by nvl(t1.del_status,t1.cust_type) order by t1.cust_id)
21 , ntile((select count(distinct nvl(t2.del_status,t2.cust_type))-1 from mytable t2)) over (parti
tion by nvl(del_status,cust_type) order by cust_id)
22 incharge
23 from mytable t1
24 order by incharge, t1.cust_type, t1.cust_id
25 /
, ntile((select count(distinct nvl(t2.del_status,t2.cust_type))-1 from mytable t2)) over (partition
ERROR at line 21:
ORA-30488: argument should be a function of expressions in PARTITION BY
SQL> The number of incharges could change during the time.
Message was edited by:
Sven Weller -
SQL experts please help for a query
I have following table1.
What query can give the result as given below, SQL experts please help on this.
TABLE1
Event DATETIME
in 2/JAN/2010
out 2/JAN/2010
in 13/JAN/2010
out 13/JAN/2010
in 5/JAN/2010
out 5/JAN/2010
RESULT REQUIRED FROM THE SQL QUERY
COL1_IN COL2_OUT
2/JAN/2010 2/JAN/2010
13/JAN/2010 13/JAN/2010
5/JAN/2010 5/JAN/2010I tried to help, but this puzzles me.
Why is this not returning pre-selected set of rows, why it's doing some merge join cartezian ?
SQL> select * from v$version;
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Prod
PL/SQL Release 10.2.0.4.0 - Production
CORE 10.2.0.4.0 Production
TNS for Linux: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production
SQL> select * from table1;
EVENT DATETIME
in 2/JAN/2010
out 2/JAN/2010
in 13/JAN/2010
out 13/JAN/2010
in 5/JAN/2010
out 5/JAN/2010
6 rows selected.
SQL> explain plan for
2 with a as
(select datetime from table1 where event='in'),
b as
(select datetime from table1 where event='out')
select a.datetime COL1_IN ,b.datetime COL2_OUT from a,b ;
Explained.
SQL> set wrap off
SQL> set linesize 200
SQL> select * from table(dbms_xplan.display);
PLAN_TABLE_OUTPUT
Plan hash value: 185132177
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 9 | 288 | 8 (0)| 00:00:01 |
| 1 | MERGE JOIN CARTESIAN| | 9 | 288 | 8 (0)| 00:00:01 |
|* 2 | TABLE ACCESS FULL | TABLE1 | 3 | 48 | 3 (0)| 00:00:01 |
| 3 | BUFFER SORT | | 3 | 48 | 5 (0)| 00:00:01 |
|* 4 | TABLE ACCESS FULL | TABLE1 | 3 | 48 | 2 (0)| 00:00:01 |
PLAN_TABLE_OUTPUT
Predicate Information (identified by operation id):
2 - filter("EVENT"='in')
4 - filter("EVENT"='out')
Note
- dynamic sampling used for this statement
21 rows selected.
SQL> with a as
(select datetime from table1 where event='in'),
b as
(select datetime from table1 where event='out')
select a.datetime COL1_IN ,b.datetime COL2_OUT from a,b ;
COL1_IN COL2_OUT
2/JAN/2010 2/JAN/2010
2/JAN/2010 13/JAN/2010
2/JAN/2010 5/JAN/2010
13/JAN/2010 2/JAN/2010
13/JAN/2010 13/JAN/2010
13/JAN/2010 5/JAN/2010
5/JAN/2010 2/JAN/2010
5/JAN/2010 13/JAN/2010
5/JAN/2010 5/JAN/2010
9 rows selected.
SQL> -
Help for a query with minus clause
I want to write a query like this:
select a.field
from table_1 a
minus
select b.field
from table_2 b
where not exists (select 1
from table_3 c
where c.field = a.field);
Unfortunately I get:
ERROR at line 8:
ORA-00904: invalid column name
Can you help me?
Thanks!Hi,
Mark1970 wrote:
I want to write a query like this:
select a.field
from table_1 a
minus
select b.field
from table_2 b
where not exists (select 1
from table_3 c
where c.field = a.field);
Unfortunately I get:
ERROR at line 8:
ORA-00904: invalid column name
Can you help me?
Thanks!Table_1 and its alias, a, are only in scope in the first branch of the query, before the keyword MINUS. The second branch, after MINUS, must be a complete self-contained query.
There are many ways to re-write the query, including:
select a.field
from table_1 a1
minus
select b.field
from table_2 b
where not exists (
select 1
from table_3 c
JOIN table_1 a ON c.field = a.field
);It's suspicious that the EXISTS sub-query does not depend on anything in table_2. Are you sure this is what you want to do?
If you'd like help, post a little sample data (CREATE TABLE and INSERT statements for all three tables) and the results you want from that data. -
Need help for the query columns to rows
Hi everyone,
I have two tables TABLE1 and TABLE2; TABLE1 is Master table,TABLE2 is child table.
The key for TABLE1 is C1 column
The key for TABLE2 is C1,C_MONTH Columns
The sample data is as follows
TABLE1
======
C1 C2
1 A
2 B
3 C
4 D
TABLE2
======
C1 C_MONTH C3
1 JAN AAA
1 FEB BBB
1 MAR CCC
1 APR DDD
2 JAN ZZZ
2 FEB YYY
2 MAR XXX
2 APR UUU
I want to display the data as follows
1 A JAN AAA FEB BBB MAR CCC APR DDD
2 B JAN ZZZ FEB YYY MAR XXX APR UUU
Can any one help me how to write this query?
Thanks in advance[email protected] wrote:
Thanks for the update
but I want the out put as column values rather than one column as follows
C1 C2 J_MONTH J_VALUE F_MONTH F_VALUE M_MONTH M_VALUE A_MONTH A_VALUE
1 A JAN AAA FEB BBB MAR CCC APR DDD
2 B JAN ZZZ FEB YYY MAR XXX APR UUUThis is a standard pivot.
In 10g or below you can do something like...
SQL> ed
Wrote file afiedt.buf
1 with table1 as (
2 select 1 c1, 'A' c2 from dual union all
3 select 2, 'B' from dual union all
4 select 3, 'C' from dual union all
5 select 4, 'D' from dual
6 ),
7 table2 as (
8 select 1 c1, 'JAN' C_MONTH,'AAA' C3 from dual union all
9 select 1,'FEB','BBB' C3 from dual union all
10 select 1,'MAR','CCC' C3 from dual union all
11 select 1,'APR','DDD' C3 from dual union all
12 select 2,'JAN','ZZZ' C3 from dual union all
13 select 2,'FEB','YYY' C3 from dual union all
14 select 2,'MAR','XXX' C3 from dual union all
15 select 2,'APR','UUU' C3 from dual
16 )
17 -- end of test data
18 select table1.c1, table1.c2
19 ,max(decode(c_month, 'JAN', c_month)) as jan_month
20 ,max(decode(c_month, 'JAN', c3)) as jan_value
21 ,max(decode(c_month, 'FEB', c_month)) as feb_month
22 ,max(decode(c_month, 'FEB', c3)) as feb_value
23 ,max(decode(c_month, 'MAR', c_month)) as mar_month
24 ,max(decode(c_month, 'MAR', c3)) as mar_value
25 ,max(decode(c_month, 'APR', c_month)) as apr_month
26 ,max(decode(c_month, 'APR', c3)) as apr_value
27 from table1 join table2 on (table1.c1 = table2.c1)
28* group by table1.c1, table1.c2
SQL> /
C1 C JAN JAN FEB FEB MAR MAR APR APR
1 A JAN AAA FEB BBB MAR CCC APR DDD
2 B JAN ZZZ FEB YYY MAR XXX APR UUU
SQL>From 11g upwards you can use the new PIVOT keyword. -
Dear all,
I have data in a table with 3 columns.
Tabke name---test & columns are ....
Proeductioncode varchar2(5);
revisionno varchar2(3);
dateadopted char(8);
SELECT PRODUCTIONCODE,
REVISIONNO,
dateadopted
FROM test
where
productioncode ='CI50E';
output should be
productioncode revisionno dateadopted
CI50E 004 20110125
CI50E 001 20101104
CI50E 003 20110320
CI50E 002 20101214
My requirement is
I wanna display records which are dateadopted is > sysdate and
one record which is less than sysdate, which is the max(<sysdate)..
from the data above, the output should be
CI50E 003 20110320
CI50E 004 20110125
Please help me get this output. we need to write it in a select query.Sorry I don't have a database available to test - missed to join by productioncode :( grouping by revisionno caused more than one row being returned :(
No need to send data. I added a data providing subquery. Will take shot when I get to the database, but I might not be able to post from the office
with
/* generating test data */
test as
(select 'CI50E' productioncode,'004' revisionno,'20110125' dateadopted from dual union all /* 003 if increasing by date */
select 'CI50E','001','20101104' from dual union all
select 'CI50E','003','20110320' from dual union all /* 004 if increasing by date */
select 'CI50E','002','20101214' from dual union all
select 'XI50Y','001','20110220' from dual union all
select 'XI50Y','002','20110220' from dual union all
select 'XI50Y','003','20110304' from dual
/* end of test data generation */
SELECT productioncode,revisionno,dateadopted
FROM (select productioncode,revisionno,dateadopted
from test a
where (dateadopted > to_char(sysdate,'yyyymmdd'))
or dateadopted = (select max(dateadopted)
from test
where productioncode = a.productioncode
and dateadopted < to_char(sysdate,'yyyymmdd')
ORDER BY PRODUCTIONCODERegards
Etbin
Edited by: Etbin on 20.2.2011 21:58
did some alignment
Edited by: Etbin on 21.2.2011 7:39
missing right parenthesis added, group by clause removed since there is just a single product
Edited by: Etbin on 21.2.2011 7:52
some more data edit
Maybe you are looking for
-
Can I send money from my iTunes account to buy apps?
i just got my new ipod touch 5<3 i love it its awesome in everyway, but i got a gift card for itunes and not for the app store so i was wondering if there was a way to send/transfer/or share money between the two accounts since their under the same a
-
Adding Movies/TV Shows to 12.1 no longer works
After updating to 12.1.0.71 on windows, seeing the following issues 1. Can no longer add videos (Movies and TV Shows) to itunes 2. Attempt to play a movie or tv show on itunes the following message is received: "This Movie requires quick time which
-
Everytime i'm in Preview now when I go to print it crashes. Please help. New Mac Mini running Lion
-
Can my iPod touch break from a drop?
Ok so I accidently dropped my iPod at school the other day. The screen is still in perfect condition and did not break at all. However a week later after updating/restoring the iOS, the iPod keeps on freezing. I also see that there appears to be a CR
-
Hi,guys,how to disable a downloaded pdf openned by Acrobat automatically?
Hi, guys. Whenever a pdf is downloaded by IE, it will be openned by Acrobat automatically. This disturbs me to download the next pdf. Is there any way to disable it? Thank you very much!