How to display data in a required format by SQL Select Query?
Hi,
i have a table named HR_PAYSLIP consisting of 4 columns empno, month, year, basic pay.
well i like to display the month wise basic salary
through a select query from the table
like this format;
EMPNO JAN FEB MAR APR MAY JUN JUL AUG SEP OCT NOV DEC
00094 122 153 145 224 245 545 114 544 444 111 555 222
00095 233 123 145 224 205 545 114 444 444 111 555 222
00096 163 123 145 224 215 545 114 551 444 111 555 222
00097 154 123 145 294 255 545 114 144 444 111 555 222
conditions:
where condition: where year = 2007
the employee no may be more and that must be displayed only one time like above for year,
and if the basic salary is zero for a month then it should be displayed as zero for a particular month as below
eg:
EMPNO, JAN FEB MAR APR MAY JUN JUL AUG SEP OCT NOV DEC
00094 122 153 0 224 245 545 114 544 444 111 555 222
Table Structure:
EMPNO NUMBER(10)
YEAR NUMBER(4)
MONTH NUMBER(2)
BASIC_PAY NUMBER(15)
Pls note: Month is stored in the table as 1 to 12.
From the FAQ
{message:id=9360005}
Similar Messages
-
How to capture all the rows returned from a sql select query in CPO
Hi,
I am executing an sql select query which returns multiple rows. I need to capture the values of each row to specific variables. How do I proceed.
Thanks,
SwatiThe select activities ("Select from Oracle," Select from SQL Server," etc.) against database already return tables. Use one of the database adapters to do your select, and it will already be in a table form. Just put your query in the select and identify the columns in your result table. The online help or the database adapter guides in the product documentation can help.
-
How to display Date Calendar in Oracle BI Answers Prompts (parameter)
I'm still new to OBIEE.
How to display Date Calendar in Oracle BI Answers Prompts (parameter)?
Thanks.Hi,
While creating Dash Board prompt choose the control to 'Calendar'.
I think it is not possible to provide 'Calendar' control using Prompts tab while creating request.
It is possible to write Java Script for a Column of data type 'char'. So, cast the date data type to char.
Go to: Column Properties --> Data Format
Choose override default data format to view the available options in the drop down list.
I would be very happy if anybody acknowledge me that I am wrong.
-Vency -
How to display data from a recordset based on data from another recordset
How to display data from a recordset based on data from
another recordset.
What I would like to do is as follows:
I have a fantasy hockey league website. For each team I have
a team page (clubhouse) which is generated using PHP/MySQL. The one
area I would like to clean up is the displaying of the divisional
standings on the right side. As of right now, I use a URL variable
(division = id2) to grab the needed data, which works ok. What I
want to do is clean up the url abit.
So far the url is
clubhouse.php?team=Wings&id=DET&id2=Pacific, in the end all
I want is clubhouse.php?team=Wings.
I have a separate table, that has the teams entire
information (full team name, short team, abbreviation, conference,
division, etc. so I was thinking if I could somehow do this:
Recordset Team Info is filtered using URL variable team
(short team). Based on what team equals, it would then insert this
variable into the Divisional Standings recordset.
So example: If I type in clubhouse.php?team=Wings, the Team
Info recordset would bring up the Pacific division. Then 'Pacific'
would be inserted into the Divisional Standings recordset to
display the Pacific Division Standings.
Basically I want this
SELECT *
FROM standings
WHERE division = <teaminfo.division>
ORDER BY pts DESC
Could someone help me, thank you.Assuming two tables- teamtable and standings:
teamtable - which has entire info about the team and has a
field called
"div" which has the division name say "pacific" and you want
to use this
name to get corresponding details from the other table.
standings - which has a field called "division" which you
want to use to
give the standings
SELECT * FROM standings AS st, teamtable AS t
WHERE st.division = t.div
ORDER BY pts DESC
Instead of * you could be specific on what fields you want to
select ..
something like
SELECT st.id AS id, st.position AS position, st.teamname AS
team
You cannot lose until you give up !!!
"Leburn98" <[email protected]> wrote in
message
news:[email protected]...
> How to display data from a recordset based on data from
another recordset.
>
> What I would like to do is as follows:
>
> I have a fantasy hockey league website. For each team I
have a team page
> (clubhouse) which is generated using PHP/MySQL. The one
area I would like
> to
> clean up is the displaying of the divisional standings
on the right side.
> As of
> right now, I use a URL variable (division = id2) to grab
the needed data,
> which
> works ok. What I want to do is clean up the url abit.
>
> So far the url is
clubhouse.php?team=Wings&id=DET&id2=Pacific, in the end
> all
> I want is clubhouse.php?team=Wings.
>
> I have a separate table, that has the teams entire
information (full team
> name, short team, abbreviation, conference, division,
etc. so I was
> thinking if
> I could somehow do this:
>
> Recordset Team Info is filtered using URL variable team
(short team).
> Based on
> what team equals, it would then insert this variable
into the Divisional
> Standings recordset.
>
> So example: If I type in clubhouse.php?team=Wings, the
Team Info recordset
> would bring up the Pacific division. Then 'Pacific'
would be inserted into
> the
> Divisional Standings recordset to display the Pacific
Division Standings.
>
> Basically I want this
>
> SELECT *
> FROM standings
> WHERE division = <teaminfo.division>
> ORDER BY pts DESC
>
> Could someone help me, thank you.
> -
Hi all,
can any one tell me how to display data in a table when user click on a button. i have created a node with a set of fields from different tables now how to write the logic to display data in that table.
Thanks & Regards,
NaveenDATA lo_nd_professionaltable TYPE REF TO if_wd_context_node.
DATA lo_el_professionaltable TYPE REF TO if_wd_context_element.
DATA ls_professionaltable TYPE wd_this->ElementS_professionaltable. "internaltable
TYPES: BEGIN OF TY_PFTAB,
RATEGROUP TYPE /BIC/OIWRATEGRP,
LEVEL TYPE /BIC/OIWPCSLEVEL,
FROMDATE TYPE /BI0/OIDATEFROM,
FROMTO TYPE /BI0/OIDATETO,
STANDARD TYPE /BIC/OIWSTRATE,
OVERHEAD1 TYPE /BIC/OIWOHRTE1,
OVERHEAD2 TYPE /BIC/OIWOHRTE2,
OVERHEAD3 TYPE /BIC/OIWOHRTE3,
EXCEPTIONFLAG TYPE /BIC/OIMSECFILER,
END OF TY_PFTAB.
DATA : IT_PFTABLE TYPE STANDARD TABLE OF TY_PFTAB,
WA_PFTAB TYPE TY_PFTAB.
SELECT /BIC/WRATEGRP /BIC/WPCSLEVEL DATEFROM DATETO /BIC/WSTRATE /BIC/WOHRTE1 /BIC/WOHRTE2 /BIC/WOHRTE3
FROM /BIC/AGLDCPRTS00 INTO TABLE IT_PFTABLE.
*TYPES : BEGIN OF TY_EXCEPTION,
EXCEPTIONFLAG TYPE /BIC/OIMSECFILER,
END OF TY_EXCEPTION.
*DATA : IT_EXTABLE TYPE STANDARD TABLE OF TY_EXCEPTION,
WA_EXTABLE TYPE IT_EXTABLE.
*SELECT /BIC/MSECFILER FROM /BIC/AGLDCLMLT00 INTO TABLE IT_EXTABLE.
navigate from <CONTEXT> to <PROFESSIONALTABLE> via lead selection
lo_nd_professionaltable = wd_context->get_child_node( name = wd_this->wdctx_professionaltable ).
get element via lead selection
lo_el_professionaltable = lo_nd_professionaltable->get_element( ).
@TODO handle not set lead selection
IF lo_el_professionaltable IS INITIAL.
ENDIF.
get all declared attributes
lo_el_professionaltable->get_static_attributes(
IMPORTING
static_attributes = ls_professionaltable ).
lo_nd_professionaltable->bind_table( new_items = IT_PFTABLE set_initial_elements = abap_false ). -
How to display data elements in the tempalte header
Hello friends
i've this date_from and date_to parameters which are date parameters that user enters..
based on these date parameters I want to display them in the header as
day of date_from(for example if the date_from is 13-nov-2010.then I should display 13)and for date_to it should dispaly as 15 if for example the user enters
16-nov-2010.(date-1's day)
so it should break down to
date_from-13-nov-2010, 13
date_to- 16-nov-2010, 15
I want these two values to be displayed in the header of the template how to do this
pls help
also let me know how to display data elements in the template header
Edited by: erp on Dec 22, 2010 12:44 AMHi Ananth..Thanks for ur timely reply
Can I use it with <? substring(':date_from',1,2)?>
where date_from is an input parameter which user enters at the run time of the report.
I've to capture the date entered by the user and print it in the header..
Pls reply -
How to display data depend upon ListBox value?
Hi Experts and Particularly Hema,
As I asked before how to display data in the ListBox, I got an very good response from you all(particularly Hema) .
Now what my doubt is asked with sample scenario below:
In Screen Painter -
Two fields namely : One List Box and other is I/O used only for displaying purpose i.e., only for output, not for input purpose.
List Box is filled by primary key field(C1) value from one table(T1) when the screen load.(i.e., such code is written in PBO).
Now what I need is :
If the user select any one value in the List Box then it automatically display the corresponding C2 value from T1 in the I/O field.
I think you may all understand what I am trying to ask.Please let me know the solution.
Thanks in advance,
Regards,
RaghuSimply attached a function code for the listbox... when the user changes the value, you will be able to pick this up in the PAI and loop back to the PBO and redisplay the corresponding output field.
Jonathan -
How to display date and time on jsf page
Hi,
how to display date and time on jsf page
we are using 11.2.0.0 jdeveloper on windows.
thanks
Edited by: user12187801 on 26-Jul-2012 01:42Your question is certainly lacking some information.
If you want a constantly updating date/time - then JavaScript is your best bet, and Google would find you examples like [url http://www.webestools.com/scripts_tutorials-code-source-7-display-date-and-time-in-javascript-real-time-clock-javascript-date-time.html]this
If you meant something else, then it's back to you to explain. -
Display data in log file using PL/SQL procedure
Just as srw.message is used in Oracle RDF Reports to display data in log file in Oracle Apps, similarly how it is possible to display data in log file using PL/SQL procedure?
Please also mention the syntax too.Pl post details of OS, database and EBS versions.
You will need to invoke the seeded FND_LOG procedure - see previous discussions on this topic
Enable debug for pl/sql
https://forums.oracle.com/forums/search.jspa?threadID=&q=FND_LOG&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
HTH
Srini -
How to display number of rows as columns in a select statement? This is on
How to display number of rows as columns in a select statement? This is on 10g R2.
Thanks,
RFor the current (ie. row 1 of 100)
row_number over (order by -pick_a_column_set) as rnfor the total number of columns returned in your query
count(*) over() as total_count -
How to align the text in justify format with SQL Server Reporting Services?
How to align the text in justify format In SQL server Reporting Services? Is there any code to do so?
Hi,
I'm afraid that if you want to have this kind of functionality, you will need to write a custom control. Here is an example: http://msdn2.microsoft.com/en-us/library/ms345265.aspx. The issue with custom controls is that it needs to be known by all the reportservers that will render your report.
Greetz,
Geert
Geert Verhoeven
Consultant @ Ausy Belgium
My Personal Blog -
How to see the wait events info. after excute a select query
Hi
How to see the wait events info. after execute a select query. Are there any parameter to set for this option?
And also wanna see the follwing info. in trace file. For this what are the parameters I have to set right?
SELECT * FROM emp, dept
WHERE emp.deptno = dept.deptno;
call count cpu elapsed disk query current rows
Parse 1 0.16 0.29 3 13 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 1 0.03 0.26 2 2 4 14
Misses in library cache during parse: 1
Parsing user id: (8) SCOTT Regards
Arpitha$ sqlplus scott/tiger
SQL*Plus: Release 10.2.0.2.0 - Production on Wed Apr 20 15:29:33 2011
Copyright (c) 1982, 2005, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> SHOW PARAMETER dump
NAME TYPE VALUE
background_core_dump string partial
background_dump_dest string /user/oracle/app/oracle/admin/
orclsb/bdump
core_dump_dest string /user/oracle/app/oracle/admin/
orclsb/cdump
max_dump_file_size string UNLIMITED
shadow_core_dump string partial
user_dump_dest string /user/oracle/app/oracle/admin/
orclsb/udump
SQL> ALTER SESSION SET EVENTS='10046 trace name context forever, level 12';
Session altered.
SQL> SELECT * FROM emp WHERE deptno=20;
EMPNO ENAME JOB MGR HIREDATE SAL COMM
DEPTNO
7369 SMITH CLERK 7902 17-DEC-80 800
20
7566 JONES MANAGER 7839 02-APR-81 2975
20
7788 SCOTT ANALYST 7566 19-APR-87 3000
20
EMPNO ENAME JOB MGR HIREDATE SAL COMM
DEPTNO
7876 ADAMS CLERK 7788 23-MAY-87 1100
20
7902 FORD ANALYST 7566 03-DEC-81 3000
20Now
$ pwd
/user/oracle/app/oracle/admin/orclsb/udump
$ ls -ltr|tail -5
-rw-r----- 1 oracle oinstall 622 Apr 20 11:35 orclsb_ora_949.trc
-rw-r----- 1 oracle oinstall 651 Apr 20 11:35 orclsb_ora_976.trc
-rw-r----- 1 oracle oinstall 1982 Apr 20 11:35 orclsb_ora_977.trc
-rw-r----- 1 oracle oinstall 1443 Apr 20 15:29 orclsb_ora_1251.trc
-rw-r----- 1 oracle oinstall 279719 Apr 20 15:30 orclsb_ora_1255.trc
$ tkprof orclsb_ora_1255.trc orclsb_ora_1255.txt
TKPROF: Release 10.2.0.2.0 - Production on Wed Apr 20 15:32:17 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
$ ls -ltr|tail -5
-rw-r----- 1 oracle oinstall 651 Apr 20 11:35 orclsb_ora_976.trc
-rw-r----- 1 oracle oinstall 1982 Apr 20 11:35 orclsb_ora_977.trc
-rw-r----- 1 oracle oinstall 1443 Apr 20 15:29 orclsb_ora_1251.trc
-rw-r----- 1 oracle oinstall 279719 Apr 20 15:30 orclsb_ora_1255.trc
-rw-r--r-- 1 oracle oinstall 26872 Apr 20 15:32 orclsb_ora_1255.txtThis orclsb_ora_1255.txt contains the required information. -
How to escape the special character ' (ascii 39) in a select query?
Hi,
does anybody know how to escape the special character ' (ascii 39) in a select query?
I've tried a lot of ways but nothing seems to work, for example I try to get all
names in table foo where coloumn name contains a '-sign (ascii 39)
select name from foo where name like '%\'%';
select name from foo where name like '%{'}%';
select name from atg_horse where name like '%chr(39)%'
... but neither works, I end up with a ORA-01756: quoted string not properly terminated
I would apriciate any help
/Carl-Michaelfriends
thanks for ur time and effort that u gave to reply to my problem.
But my main problem is that when my application (VC++ 7) fires the following query in the oracle database , it does not return any rows.
SELECT count(*) FROM ORGANISATION WHERE UPPER(ORGANISATION.ORGANISATIONNAME)
LIKE N'β%' ORDER BY ORGANISATION.ORGANISATIONNAME
the above question in the previous thread was just to check on sql plus as it's editor does not support unicode characters. -
How to Get the Job, Cost center, Position description using select query
Hi all,
How to get the Job, Cost center, Position description through select query without using the Function module?
thanks,
Prasaduse adhoq query and take the report chose both text and value
-
How to display date in dd-mon-yyyy hh:mm am/pm format
Hi,
I want to display date in dd-mon-yyyy hh:mm format in OA Page. Can any body pls give me sample code that i can write in the controller.
Regards,
RamThe date format in OAF Pages is controlled by profile ICX: Date format mask.This profile can be set at site as well as user level for the individual users to set the Date format.
But I would advice not to go for setting different profile values at user level, because i remember some old threads, where seeded Oracle pages fail, as code their is not generalised to handle date formats.
--Mukul
Maybe you are looking for
-
How to find the ID of the text item of the column in an tabular form
Hello, I have created a tabular form report on emp table and made ONE OF THE COLUMN department_id as an text item using APEX_ITEM.TEXT APIs. My select query is select "EMPLOYEE_ID", "EMPLOYEE_ID" EMPLOYEE_ID_DISPLAY, "FIRST_NAME", "LAST_NAME", "HIRE_
-
Crazy Metadata Errors Hope system is secure? Is this a install bug or what
Jan 3 20:02:01 localhost Install OS X Mavericks[376]: @(#)PROGRAM:Install PROJECT:Install-846 Jan 3 20:02:01 localhost Install OS X Mavericks[376]: @(#)PROGRAM:IA PROJECT:InstallAssistant-469.5 Jan 3 20:02:01 localhost Install OS X Mavericks[376
-
TableCellRenderer -- not showing as "selected" in JTable
Hi, I have a a JTable, and for one of my columns, i do for (int i = 0; i < dataModel.getColumnCount(); i++) { column = table.getColumnModel().getColumn(i); if (i ==0) column.setCellRenderer(new NotificationCellRenderer
-
Prior to replacing the HD, I was able to hold the option key while powering on and it would prompt me for startup device. HD was formatted, but no OS install (thought I could just do Time Machine recovery). Connected to Time Capsule again (via Ethe
-
Want to laugh? Read my n00b question..
Hi, Ok, I found out that the a class contained in a Jar file I downloaded contains some methods I almost could use out of the box. I just need to modify one of the methods, and then I am good to go. So, silly me I thought I could make a class of my o