Display A List Of All Book Titles Along With Their Percentage Of Markup?

Jul 14, 2013

I've gotten it to display the percentage of markup correctly(as in, multiplied by 100 with no decimal places), but I cannot for the life of me get the percentage sign to display on the right of the values(i.e. 40, but not 40%).

Here's my code so far:

SELECT title, to_char(round((retail-cost)/retail*100), '99')
AS "MARKUP %" FROM BOOKS;

I've tried concatenating with both the + sign and the ampersand (&) sign, to no avail.

View 1 Replies


ADVERTISEMENT

SQL & PL/SQL :: Display Data Based On Group And Percentage?

Feb 12, 2012

I have the following requirement, where I have to display the data based on the group and links when input is given as month. I have written the following code, which is good to display for group. But I want to display for all the groups.
CREATE TABLE target_data
(
T_LINK VARCHAR2(50)
, t_mon varchar2(6)
, t_grp varchar2(30)
, t_views NUMBER

[code]...

When I run this, I get output as

t_grp count_80 goal
grp3 1 0.1

But I want the output as

t_grp count_80 goal
grp3 1 0.1
grp2 1 0.1
grp1 ... ...
grp0 ... ...

View 16 Replies View Related

Client Tools :: Sql With Markup HTML - Oracle 9.2 And 10.2.0.3

Jun 20, 2013

i have a problem i've done a script sql with markup HTML ,but the version of oracle 9.2 give me a results different respetct a Oracle 10.2.0.3

The report don't show the header .

This code sql :

SET MARKUP HTML ON SPOOL ON PREFORMAT OFF ENTMAP ON -
HEAD "<TITLE>File Crif Istruttoria</TITLE> -
<STYLE type='text/css'> -
<!-- BODY {background: #FFFFC6} --> -

[Code]...

Which is the error .

View 9 Replies View Related

How To Display Hierarchy List

Oct 1, 2009

query in order to display a hierarchy list. Example:

Database has three tables

Heading --> id, status, order, title
Sub-heading --> id, status, order, title, heading_id
Item --> id, status, order, title, heading_id, sub-heading_id, actual_content

order = the sequence in which they are to be displayed a sub-heading's heading_id refers to the parent heading, likewise an item's sub-heading_id refers to the parent sub-heading.

I assumed there was no need to track child content.

Now, the output format should be something like this, where the sub-headings are not repeated, nor are the items. Sort of like chapters in a book, things in a catalogue, or even topics in a forum.

Heading 1
Sub-heading 1
Item 1
Item 2
Item 3
Sub-heading 2
Item 1
Item 2
Item 3
Heading 2
Sub-heading 1
Item 1
Item 2
Item 3
Heading 3
Sub-heading 1
Item 1
Item 2
Item 3
Sub-heading 2
Item 1
Item 2
Item 3
Sub-heading 3
Item 1
Item 2
Item 3

Where I'm getting hung up is how to query the data so it's quick, efficient, clean and easy to read and maintain. I've only gotten to listing the sub-headings and already the query looks convoluted. So, how should I approach this? Should it be done all in one query, and always checking against the results to know when to print a new heading or sub heading. Or should I run multiple queries and save the results to a variable, and then run sub-queries off that? Is there a better way to do this, am I going about it the hard way or am I in the right direction and just haven't gone far enough with it yet?

View 11 Replies View Related

SQL & PL/SQL :: Display In List Non-Existent Value In Output

Mar 6, 2012

I am not sure if this is even possible however I will give it a try here. is there a way to take a value from an In List that doesn't exist in the table and get SQL PLus to output that value with an assigned decode construct. example.

1 select decode(count(object_name),1,'EXIST',null,'NOT EXIST',0,'NOT EXIST'),
2 object_name, object_type
3 from dba_objects where object_name in (
4 'GV_$METRICNAME',
5 'GV$METRICNAME',
6 'GV_$METRICGROUP',
7 'GV$METRICGROUP',
8 'ABC'
9 )
10* group by object_name, object_type
SQL> /

DECODE(CO OBJECT_NAME OBJECT_TYPE
--------- ------------------------- -------------------
EXIST GV_$METRICNAME VIEW
EXIST GV_$METRICGROUP VIEW
EXIST GV$METRICNAME SYNONYM
EXIST GV$METRICGROUP SYNONYM

and have it look like this:

DECODE(CO OBJECT_NAME OBJECT_TYPE
--------- ------------------------- -------------------
EXIST GV_$METRICNAME VIEW
EXIST GV_$METRICGROUP VIEW
EXIST GV$METRICNAME SYNONYM
EXIST GV$METRICGROUP SYNONYM
NOT EXIST ABC

View 4 Replies View Related

SQL & PL/SQL :: Display All Values In Same Order As In IN List

Mar 29, 2010

I had a table main with 2 fields. please see the contents below.

seq name
a aaa
b bbb
c ccc
d ddd

1. My query is as below

select seq,name from main where seq in ('a','b','c','b','d','d') output of query is

a aaa
b bbb
c ccc
d ddd

but I need the output to be as shown below.

a aaa
b bbb
c ccc
b bbb
d ddd
d ddd

I need to display all the values in the same order as in the "IN" list.

View 18 Replies View Related

SQL & PL/SQL :: Procedure To Display Data From Drop Down List

Feb 6, 2012

I have to write a proc to display data based on user input for t_grp, and it should exclude grp0

So below is the proc I have written, and I want to display the report for all t_grp when user gives user_input as All or gives null. How can I acheieve this is in procedure.

table: target_data

create table target_data
(
t_mon varcahr2(6)
, t_grp varchar2(30)
, t_data varchar2(50)
)
;
INSERT INTO target_data VALUES ('Apr-11', 'grp1', 'some_data');
INSERT INTO target_data VALUES ('Apr-11', 'grp2', 'some_data');
INSERT INTO target_data VALUES ('Apr-11', 'grp4', 'some_data');
[code]......

Now the above proc is running fine, if I give the input as grp1 or any other t_grp.

View 2 Replies View Related

Application Express :: Get Display Value From Select List

Sep 9, 2012

I am using Apex 4.1 and I have a select list in my page. I know i can access the value of the selected item by :P1_SelectList, but I would like to know how to access the display value of the selected item.

View 6 Replies View Related

Application Express :: Display Value Into List Manager Box

Feb 15, 2013

i am using List Manager Item .i have use List of values (lov)

SELECT LD.LOOKUP_NAME d ,LD.ID r FROM CRM_LOOKUP_MAS LM,
CRM_LOOKUP_DTL LD
WHERE LM.LOOKUP_ID=LD.LOOKUP_ID
AND LM.LOOKUP_TYPE='TRAVEL RHYTHM' and LD.ACTIVE_FLAG='Y'
order by LD.LOOKUP_NAME
}

when i click to add new value and click then pop up window open with LD.LOOKUP_NAME display value but when i click on add Button then value added in to below box with LD.ID

i want to display here my LD.LOOKUP_NAME value into below box.

How can i do this.

View 0 Replies View Related

Application Express :: Select List Read Only / Or Display Only

Sep 3, 2012

I have Select list itemS based on Lookup tables. When the form in Edit mode, I want to prevent the end user from changing the value of these Select list items. How can I accomplish this ??? **If I change the type of the item to Display only, then it will show the returned value of the Select list.

View 1 Replies View Related

Application Express :: Display Quarter Of Year As Select List

Jul 16, 2012

I need to display quarter of current year in select list.

for example current year is 2012 so, i want Jan-Mar 2012,Apr-Jun 2012,July-Sept 2012,Oct-Dec 2012 in select list.

View 3 Replies View Related

Express Edition (XE) :: Display A List Of All User And Admin Accounts

Jan 28, 2013

I've installed XE and I want to know what accounts are active. If I log in to SQL*Plus as sys as SYSDBA how can I display a list of all user and admin accounts? I want to know who can log in.

View 3 Replies View Related

Application Express :: Display List Of All Users On Page / Accessing Or Using Application

Mar 23, 2013

i want to display a list of all users on a page those currently accessing or using the application. How do i accomplish this requirement?

View 1 Replies View Related

Get Percentage Calculations?

Jan 21, 2012

I am fairly new to Oracle SQL developer and I am having an issue that may very simple but I just cannot work it out logically for some reason.I am trying to calculate the percentage of sales each employee has made form the total of trades. I have been trying to use the COUNT function but it obviously splits the counts for each employee. I then tried a inline view but couldn't get it to work and also a sub-query and had an issue with "not a single group function" and then "not a GROUP BY expression".

how I can do this? I will also need to add the syntax to another inline view

View 1 Replies View Related

SQL & PL/SQL :: Calculating Percentage Value

Jun 21, 2010

I have a one more query

col1 col2
3-18083017013-Standard
3-18083225012-Significant
3-18082775913-Standard
3-18082426912-Significant
3-18082097112-Significant
3-18081539512-Significant
3-18081946712-Significant
3-18080523612-Significant
3-18076873112-Significant
3-18076872712-Significant
3-18080522412-Significant
3-18080064612-Significant
3-18070899912-Significant
3-18081155713-Standard
3-18071160013-Standard
3-18077564213-Standard
3-18079220312-Significant
3-18073201313-Standard

note:
3-Standard 240 min
2-Significant 120 min

1) i need to calculate the percentage value.

general form is :

total number of col1_values(count) in 120 min/count(col1) *100

conditions to calculate percentage:
1)need to ca

View 16 Replies View Related

SQL & PL/SQL :: How To Calculate Running Percentage

Mar 13, 2013

I want to calculate the running percentage. sample data is as below.

CREATE TABLE prod
(
code VARCHAR2(8),
name VARCHAR2(30),
stdate DATE,
itons NUMBER(7,3),
rtons NUMBER(7,3)

[code]....

Required Output is

CODE NAME STDATE ITONS RTONS %age
-------- ------------------------------ --------- ---------- ---------- -------
0-01-001 SEEDS 17-JUL-12 193.155 0
1-01-001 OIL 17-JUL-12 0 81.906 42.404
1-02-001 MEAL 17-JUL-12 0 104.304 54.000
1-03-001 DURT OIL 17-JUL-12 0 1.242 0.643
2-01-001 WASTE 17-JUL-12 0 5.703 2.953

[code]....

Percentage will be calculated as rtons of code not having first digit 0 devided by itons having having code 0 result multiply 100 for the same date code wise e.g. For dated 17-jul-13 meal percentage will be calculated as round((104.304/193.155)*100,3)=54.000

View 6 Replies View Related

DB Time Percentage From Dba-sqlstat?

Mar 29, 2011

In this select I would like to get db time percentage for every sql_id as I can see in AWR report.How can I do this?

select
sql.sql_id ,
sql.executions_delta ,
round(sql.elapsed_time_delta/1000000) elapsed_sec,
round(sql.elapsed_time_delta/1000000)/sql.executions_delta elapsed_exec,

[code]...

View 4 Replies View Related

PL/SQL :: Count To Find Percentage

Sep 26, 2012

I want to find the Pass rate for each term by adding up the grades.

PASS = HD/D/PASS FAIL = FAIL and Z means no mark has been recieved yet so i do not want to include it in the calculation.

CREATE TABLE DAN_GR
(ID     VARCHAR2(8),
TERM    VARCHAR2(8),
GRADE VARCHAR2(8),
SUBJECT          VARCHAR2 (8),
STAT        VARCHAR2 (8))

[Code]....

So term 1201 has 1 Pass 1 Fail and a Z (which is not counted) so pass rate is 50%
term 1202 has has 1 Pass only so the pass rate is 100%
term 1203 has 1 Fail so pass rate is 0%
term 1204 has 1 Pass and 2 Fails and i dont count the 3rd fail because the stat is 'APSENT' i only want to count the once where stat is 'PRESENT'

WANT:

COUNT     TERM     PASS RATE
3     1201     50%
1     1202     100%
1     1203     0%
3     1204     33%

I am using:

Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi

View 4 Replies View Related

How To Select Maximum Percentage

Aug 10, 2012

In my table three column are there, structure_code, attribute_code and percentage. one project have many attribute_codes, each attribute code have percentage value. The total of percentage value for a project is 100.

data like follows

structure_code Attribute_code percentage

160025 2531 30
160025 2536 20
160025 2537 50
160025 2538
162061 1468 0

Now i need to select which attribute_Code have maximum percentage for each project(structure_code).

View 3 Replies View Related

Reports & Discoverer :: GP Percentage In Total

Jan 10, 2012

See the attached pdf the output of my report. I want to calculate the GP at the Total column.

My GP formula is

trunc((profit) / decode(ACTUAL,0,1,ACTUAL)*100,2).

I tried using Placeholder Column & Formula Column but it is not working. I am using grouping in INV_DATE and summing all the columns.

View 22 Replies View Related

Security :: How To Grant A Percentage Tablespace

Mar 13, 2011

Is it possible to grant a user a percentage amount of a specified tablespace ? for instance granting a user called userx 5% of USERS tablespace. How can I do that ?

View 3 Replies View Related

PL/SQL :: How To Calculate Interest Percentage Dynamically

Feb 24, 2013

look at these tables (Customer and Rates), having some sample data. I've created a function for returning the interest percentage for a particular customer based upon his/her investment start date and end date. I'm getting the desired result but I'm wondering if I need calculate the composite interest here...then how can I do that? Suppose a customer has invested some amount for 45 days, then I need to calculate the interest for initial 30 days as 5% and additional 15 days as 6% and I need to give the final amount. In this case how can I pull this task off? how can we do this interest calculation by an Oracle program?

Customer Table
CUSTOMER_ID     AMOUNT     START_DATE     END_DATE
1000             40000     15-JAN-13     15-FEB-13
1001             34000     15-DEC-12     15-FEB-13
1002             35678     15-NOV-12     15-FEB-13

Rates Table

RATE_PCT     LOW_TENURE     HIGH_TENURE
5                    0     30
6                    0     60
7                    0     90CREATE OR REPLACE FUNCTION
F_INTEREST_PCT (V_CUSTOMER_ID IN CUSTOMER.CUSTOMER_ID%TYPE)
  RETURN NUMBER AS V_RATE_PCT NUMBER;
 
[code]...

View 5 Replies View Related

Server Administration :: Estimating Memory Percentage?

May 11, 2011

estimate the percentage of memory should i can allocate from the total physical memory (it is 6G) as attached in the image file as a print screen.

View 4 Replies View Related

SQL & PL/SQL :: Finding Percentage Using Query From Table Data

Jun 23, 2010

SL_NoStatus
191502Implemented
191690Implemented
190998Implemented
191346Implemented
190541Implemented

[Code]..

my above table consists of two columnc sl_no and Status,col1 indicates the process no and the status indicates it is implemented or cancelled or failed during implementation.

i need to find the percentage of the implemented+cancelled process over failed..

test case:
lets consider,
A->count(Sl_NO)
B->Count(STATUS) where STATUS='Implemented'

[Code]..

i think i have satisfactorily given enough data.. make it out using sql query..

View 3 Replies View Related

SQL & PL/SQL :: Extract Numerical Value Preceding Percentage Sign

Jan 17, 2012

I have two values:

'AA:10%:1'
'AC:P35:20%'

I need to extract the numerical value preceding the '%' sign. for first row 10 should be extracted and for the second 20.

View 2 Replies View Related

Server Administration :: Shared Pool Free Percentage Greater Than 100

Jul 5, 2010

value of "Shared Pool Free %" in v$sysmetric is larger than 100%
SQL> select value, group_id from v$sysmetric where metric_name = 'Shared Pool Free %';
VALUE GROUP_ID
186.45107 2
186.4685382 3

SQL> show parameter shared_pool

NAME TYPE VALUE
-------------- ------------ --
shared_pool_reserved_size big integer 832149913
shared_pool_size big integer 0

SQL> show sga

Total System Global Area 1.0155E+11 bytes
Fixed Size 2163880 bytes
Variable Size 8.1068E+10 bytes
Database Buffers 2.0401E+10 bytes
Redo Buffers 79310848 bytes

View 2 Replies View Related

Application Express :: Tabular Form / Column Widths / Percentage

Jun 20, 2013

Oracle Express 4.0 I have set up a Tabular Form. It has 5 columns. I wanted to set 4 of the columns to a width of 15%. 1 column to 40%. I set the appropriate values to style=width: "15%"; and style=width: "40%"; in Column Edit's Element Attributes.  But all columns are displayed equally. If I try the format style="width: 40%" I get what appears to be 40% of the cell width for the text field (not the table width). Can %'s be used on Ellement Attributes?

View 0 Replies View Related

Performance Tuning :: How To Find Percentage Completion Of Query In Running Status

May 2, 2012

How can we check completion status for running sql query. i.e. how much % completed

SQL> begin
2 delete from gsmcrmdw.wc_loy_txn_f_aa
3 where integration_id in
4 ( select integration_id
5 from support_olap.recover_wc_loy_txn_f_953to955
6 );
7 commit;
8 end;
9 /

View 35 Replies View Related

Forms :: How To Avoid (no List Elements Defined For List Item) Error

Sep 27, 2011

I am creating the Dynamic list but when i am compiling the form it gives the compilation error "No list elements defined for the list item".

I can eliminate it by entering the dummy list element but this dummy value will be displayed at form run time.

View 1 Replies View Related

List Products List Of Client Grouped By Type Of Product?

Dec 14, 2011

Im trying to list the products list of a client grouped by type of the product. Ex:

product type

prod.A acid
prod.B flavour
prod.C acid
prod.D cleaner
prod.E flavour

I want to list something as:

Acid

Prod.A
Prod.C

Cleaner

prod.D

Flavour

prod.B
prod.E

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved