dbTalk Databases Forums  

help needed on Rouding function and other things

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss help needed on Rouding function and other things in the comp.databases.oracle.misc forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Totti
 
Posts: n/a

Default help needed on Rouding function and other things - 12-05-2007 , 01:33 AM






CREATE TABLE SQL_TABL (
ORD_DATE Date,
PROD_CODE Varchar2(10),
CUST_CODE Varchar2(10),
QTY Number(2),
UNIT_PRICE Number(5,2),
SHIP_DATE Date,
CARR_CODE Varchar2(12),
SHIP_COST Number(5,2),
PMT_DATE Date
);

insert into SQL_TABL values ('08-Jan-05', 'A-50-0013', 'Cu-08-143',
4,
181.79, '09-Jan-05', 'TransCo', 60.27, '15-Jan-05');
insert into SQL_TABL values ('15-Jan-05', 'A-25-0753', 'Cu-08-180',
13, 265.61, '23-Jan-05', 'Expedit', 278.36, '29-Jan-05');
insert into SQL_TABL values ('19-Jan-05', 'A-24-0101', 'Cu-08-133',
20, 120.18, '22-Jan-05', 'Expedit', 188.28, '29-Jan-05');
insert into SQL_ASSGN_2 values ('30-Jan-05', 'B-63-0023', 'Cu-4-078',
4,
280.88, '09-Feb-05', 'Expedit', 92.93, '04-Feb-05');


hi every one i have a a table like such and i want to do 2 things


1.Produce total sales per Product Group interval (0-9, 10-19 etc) for
sales made in 2006. Report only those groups which overall have total
sales greater than 1500.


2.Produce total sales per Product Group interval (0-9, 10-19 etc) for
sales made in 2006. Report only those groups where sales is more than
10% of grand total of sales.


*** the group code is the 2 digits between the - sign in the prod
code
i.e. A-50-0123 is of group 50
Group codes from 0 to 9 form Group0. Codes from 10 to 19 form
Group10
etc.
i know from excel that i need a rounding function to get them, but i
dont know how to imply here in oracle


Any clues please on any of the two problems??
thanks in advance



Reply With Quote
  #2  
Old   
Brian Tkatch
 
Posts: n/a

Default Re: help needed on Rouding function and other things - 12-05-2007 , 08:10 AM






On Tue, 4 Dec 2007 23:33:59 -0800 (PST), Totti
<saliba.toufic.george (AT) gmail (DOT) com> wrote:

Quote:
CREATE TABLE SQL_TABL (
ORD_DATE Date,
PROD_CODE Varchar2(10),
CUST_CODE Varchar2(10),
QTY Number(2),
UNIT_PRICE Number(5,2),
SHIP_DATE Date,
CARR_CODE Varchar2(12),
SHIP_COST Number(5,2),
PMT_DATE Date
);

insert into SQL_TABL values ('08-Jan-05', 'A-50-0013', 'Cu-08-143',
4,
181.79, '09-Jan-05', 'TransCo', 60.27, '15-Jan-05');
insert into SQL_TABL values ('15-Jan-05', 'A-25-0753', 'Cu-08-180',
13, 265.61, '23-Jan-05', 'Expedit', 278.36, '29-Jan-05');
insert into SQL_TABL values ('19-Jan-05', 'A-24-0101', 'Cu-08-133',
20, 120.18, '22-Jan-05', 'Expedit', 188.28, '29-Jan-05');
insert into SQL_ASSGN_2 values ('30-Jan-05', 'B-63-0023', 'Cu-4-078',
4,
280.88, '09-Feb-05', 'Expedit', 92.93, '04-Feb-05');


hi every one i have a a table like such and i want to do 2 things


1.Produce total sales per Product Group interval (0-9, 10-19 etc) for
sales made in 2006. Report only those groups which overall have total
sales greater than 1500.


2.Produce total sales per Product Group interval (0-9, 10-19 etc) for
sales made in 2006. Report only those groups where sales is more than
10% of grand total of sales.


*** the group code is the 2 digits between the - sign in the prod
code
i.e. A-50-0123 is of group 50
Group codes from 0 to 9 form Group0. Codes from 10 to 19 form
Group10
etc.
i know from excel that i need a rounding function to get them, but i
dont know how to imply here in oracle


Any clues please on any of the two problems??
thanks in advance


SQL_ASSGN_2 is not defined here.

It would seem that GROUP BY... HAVING .... should answer your
problems.

B.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.