ampersand problem

2001-10-05 Thread Swapna_Chinnagangannagari
Title: ampersand problem 





Why is this code not working for me



declare
code number(3):=0;
edate date;
begin
code:=111;
edate:=to_date('01-01-2001','dd-mm-');
dbms_output.put_line('actual data '||code ||','||edate);
@abc code edate
dbms_output.put_line('hello');
end;
/
 



abc.sql

declare
my_code number(3);
my_number number(3);
begin
my_code:=1;
my_number:='2';
dbms_output.put_line('data in abc '||my_code ||','||my_number);
end;
/






RE: ampersand problem

2001-10-05 Thread Swapna_Chinnagangannagari
Title: RE: ampersand problem 





sorri i have pasted the wrong one
here is the correct on


declare
code number(3):=0;
edate date;
begin
code:=111;
edate:=to_date('01-jan-2001','dd-mom-');
dbms_output.put_line('actual data '||code ||','||edate);
@abc code edate
dbms_output.put_line('hello');
end;
/
 



abc.sql

declare
my_code number(3);
my_date date;
begin
my_code:=1;
my_date:='2';
dbms_output.put_line('date in abc '||my_code ||','||my_date);
end;
/


-Original Message-
From: Swapna_Chinnagangannagari 
Sent: Friday, October 05, 2001 12:27 PM
To: '[EMAIL PROTECTED]'
Subject: ampersand problem 


Why is this code not working for me



declare
code number(3):=0;
edate date;
begin
code:=111;
edate:=to_date('01-01-2001','dd-mm-');
dbms_output.put_line('actual data '||code ||','||edate);
@abc code edate
dbms_output.put_line('hello');
end;
/
 



abc.sql

declare
my_code number(3);
my_number number(3);
begin
my_code:=1;
my_number:='2';
dbms_output.put_line('data in abc '||my_code ||','||my_number);
end;
/






OT Start Button

2001-09-16 Thread Swapna_Chinnagangannagari
Title: OT Start Button






Hello All,
 Sorry for posting a OT.
 How can i change the text of the START button.
 I'm using windows'95.


Regards
Swapna





Sql query

2001-09-09 Thread Swapna_Chinnagangannagari
Title: Sql query






Hello Friends I am struck up with typical problem.
I got this problem while querying data from Oracle Tables.
I can't explain the problem as it is with my project business jargons so
I am formulated the problem in following way.
Let us assume that table and data of it as given below:
TABLE : PLAYER 
PLAYER NAME TEAM  SCORE
Tendulkar IND 83
Tendulkar IND 42
Tendulkar IND 138
Tendulkar IND 67
Tendulkar BOMBAY 159
Dravid IND 32
Dravid IND 53
Dravid SZONE 72
Yuvaraj NZONE 91
Yuvaraj IND 27
Yuvaraj IND 42
Yuvaraj IND 12
Lara WI 83
Sewag IND 47
Sewag NZONE 17
I want the report based on the above table data as follows:
I want player name and his best 3 scores played for the team IND.
Report has to be look like as given below.
To get the following report output I need One-shot-SQL query? (I don't want any PL/SQL as solution)
PLAYER TEAM SCORE1 SCORE2 SCORE3
Tendulkar IND 138 83 67
Dravid IND 53 32 
Yuvaraj IND 42 27 12
Sewag IND 47  
I am giving u the table create script and data insert script for player table.
CREATE TABLE PLAYER (PNAME VARCHAR2(20),TEAM VARCHAR2(10), SCORE NUMBER(5));

INSERT INTO PLAYER VALUES ('Tendulkar','IND',138);
INSERT INTO PLAYER VALUES ('Tendulkar','IND',83);
INSERT INTO PLAYER VALUES ('Tendulkar','IND',42);
INSERT INTO PLAYER VALUES ('Tendulkar','IND',67);
INSERT INTO PLAYER VALUES ('Tendulkar','BOMBAY',159);
INSERT INTO PLAYER VALUES ('Dravid','IND',53);
INSERT INTO PLAYER VALUES ('Dravid','IND',32);
INSERT INTO PLAYER VALUES ('Dravid','SZONE',72);
INSERT INTO PLAYER VALUES ('Yuvaraj','NZONE',91);
INSERT INTO PLAYER VALUES ('Yuvaraj','IND',27);
INSERT INTO PLAYER VALUES ('Yuvaraj','IND',12);
INSERT INTO PLAYER VALUES ('Yuvaraj','IND',42);
INSERT INTO PLAYER VALUES ('Lara','WI',83);
INSERT INTO PLAYER VALUES ('Sewag','IND',47);
INSERT INTO PLAYER VALUES ('Sewag','NZONE',17);






RE: Sql query

2001-09-09 Thread Swapna_Chinnagangannagari
Title: RE: Sql query





Hello Larry,


Thanks alot for u'r immediate response
but i'm a not old bee in sql queries
can u please elaborate on the line 

ROW_NUMBER () OVER (PARTITION BY Pname ORDER BY Score


Regards
Swapna


-Original Message-
From: Larry Elkins [SMTP:[EMAIL PROTECTED]]
Sent: Monday, September 10, 2001 10:55 AM
To: Multiple recipients of list ORACLE-L
Subject: RE: Sql query


The following works with 8.1.6 and above:


 1 SELECT T3.Pname,
 2 T3.Team,
 3 Sum(Decode(T3.Top3,1,T3.Score)) Score1,
 4 Sum(Decode(T3.Top3,2,T3.Score)) Score2,
 5 Sum(Decode(T3.Top3,3,T3.Score)) Score3
 6 FROM (SELECT Pname,
 7 Team,
 8 Score,
 9 ROW_NUMBER () OVER (PARTITION BY Pname ORDER BY Score
DESC) Top3
10 FROM Player
11 WHERE Team = 'IND') T3
12 WHERE T3.Top3 = 3
13 GROUP BY T3.PName,
14 T3.Team
15* ORDER BY nvl(Score1,0)+nvl(Score2,0)+nvl(Score3,0) DESC
SQL /


PNAME TEAM SCORE1 SCORE2 SCORE3
 -- -- -- --
Tendulkar IND 138 83 67
Dravid IND 53 32
Yuvaraj IND 42 27 12
Sewag IND 47


I wasn't sure of the order was important, but, your output (maybe by chance)
was in descending order of the sum of the top 3 grades, thus the order by
clause you see above. Ditch it if it should be something else.


Regards,


Larry G. Elkins
[EMAIL PROTECTED]
214.954.1781
-Original Message-
Swapna_Chinnagangannagari
Sent: Sunday, September 09, 2001 9:45 PM
To: Multiple recipients of list ORACLE-L


Hello Friends I am struck up with typical problem.
I got this problem while querying data from Oracle Tables.
I can't explain the problem as it is with my project business jargons so
I am formulated the problem in following way.
Let us assume that table and data of it as given below:
TABLE : PLAYER
PLAYER NAME TEAM SCORE
Tendulkar IND 83
Tendulkar IND 42
Tendulkar IND 138
Tendulkar IND 67
Tendulkar BOMBAY 159
Dravid IND 32
Dravid IND 53
Dravid SZONE 72
Yuvaraj NZONE 91
Yuvaraj IND 27
Yuvaraj IND 42
Yuvaraj IND 12
Lara WI 83
Sewag IND 47
Sewag NZONE 17
I want the report based on the above table data as follows:
I want player name and his best 3 scores played for the team IND.
Report has to be look like as given below.
To get the following report output I need One-shot-SQL query? (I don't want
any PL/SQL as solution)
PLAYER TEAM SCORE1 SCORE2 SCORE3
Tendulkar IND 138 83 67
Dravid IND 53 32
Yuvaraj IND 42 27 12
Sewag IND 47


-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Larry Elkins
 INET: [EMAIL PROTECTED]


Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
San Diego, California -- Public Internet access / Mailing Lists

To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).





RE: simple sql problem

2001-07-31 Thread Swapna_Chinnagangannagari
Title: RE: simple sql problem





Hello Raja,


You can try this way


1)select x+y sum1 from blah


2)col sum1 format 09.99


3)select x+y sum1 from blah


rgds
swapna


-Original Message-
From: Viraj Luthra [SMTP:[EMAIL PROTECTED]]
Sent: Tuesday, July 31, 2001 12:31 PM
To: Multiple recipients of list ORACLE-L
Subject: RE: simple sql problem


No, I mean, if (x+y)  1, that is a value of .92 which it prints out, but I want it to print out like, 0.92, that is a 0. is concatenateed to the result.

therefore, when i have, 


select x+y from blah


I should get 90 when the value is really 90
and I should get 0.92 when the value is really .92


Any comments


rgds,


raja
--


On Mon, 30 Jul 2001 22:00:23 
Amar Kumar Padhi wrote:
I believe what you meant is if it is less than one then the output should be
1.
if so:

select (case when x + y  1 then x + Y
 else 1
 end) from blah;


-Original Message-
Sent: Tuesday, July 31, 2001 9:10 AM
To: Multiple recipients of list ORACLE-L


Hello all,

If I have a situation, where I have the following:-

select x+y from blah

and if x+y  1, eg 5 then the output can be 5,
but if x+y  1, eg, .92, then I need the output as 0.92.

How do I do this?

rgds,

raja


Get 250 color business cards for FREE!
http://businesscards.lycos.com/vp/fastpath/
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Viraj Luthra
 INET: [EMAIL PROTECTED]

Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
San Diego, California -- Public Internet access / Mailing Lists

To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).




Get 250 color business cards for FREE!
http://businesscards.lycos.com/vp/fastpath/
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Viraj Luthra
 INET: [EMAIL PROTECTED]


Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
San Diego, California -- Public Internet access / Mailing Lists

To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).





RE: simple sql problem

2001-07-31 Thread Swapna_Chinnagangannagari
Title: RE: simple sql problem





but this will append 0 to numbers 1 (sum (a+b) 1)
which is not the requirement


-Original Message-
From: Pulikkol Kumar [SMTP:[EMAIL PROTECTED]]
Sent: Tuesday, July 31, 2001 4:10 PM
To: Multiple recipients of list ORACLE-L
Subject: RE: simple sql problem



OR


SELECT LPAD(TO_CHAR(x+y),LENGTH(x+y)+1,'0') FROM BLAH


 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 






-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Pulikkol Kumar
 INET: [EMAIL PROTECTED]


Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
San Diego, California -- Public Internet access / Mailing Lists

To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).