Hello all,I am working with a query that does some counts. I've hit a brick wall and can't get passed trying to figure out how I can make the query show percentages %.Here is the query:select "COUNTRY", count ("MSS") "COUNT_MSS"FROM (SELECT
Viktor wrote:
Hello all,
I am working with a query that does some counts. I've hit a brick wall
and can't get passed trying to figure out how I can make the query show
percentages %.
Here is the query:
select COUNTRY,
count (MSS) COUNT_MSS
FROM (
SELECT DISTINCT
Thanks for your reply! Will try it now. Will this work in 8i?
Viktor
Bricklen Anderson [EMAIL PROTECTED] wrote:
Viktor wrote: Hello all, I am working with a query that does some counts. I've hit a brick wall and can't get passed trying to figure out how I can make the query show percentages
Viktor wrote:
Thanks for your reply! Will try it now. Will this work in 8i?
Viktor
If it works at all, then it should work in both 8i and 9i, although I
don't have a version of 8i handy right now to try this on.
--
Please see the official ORACLE-L FAQ: http://www.orafaq.net
--
Author:
PROTECTED]
Subject: SQL Query Problem(possilble duplicate send, Sorry!)
Date: Tue, 13 Jan 2004 12:34:35 -0800
Hello all,
I am working with a query that does some counts. I've hit a brick wall and
can't get passed trying to figure out how I can make the query show
percentages %.
Here is the query
Friends --
Why would these two queries return different results?
This query works.
SQL l
1 select
a.tablespace_name,megs_allocated,megs_used,round(megs_used/b.megs_allocated,
2)*100 pct
2 from (select tablespace_name,sum(bytes)/(1024*1024) megs_used
3 from dba_extents group by
Bambi,
I think that the query (2) will return the the same count as query (1)
if you use the
column user_bytes from the dba_data_files rather than the column
bytes.
If I sum the bytes from dba_extents for a tablespace_name xxx
and sum the user_bytes from dba_data_files for tablespace_name xxx I
Nice try. Same result.
1 select a. tablespace_name, sum(b.user_bytes)/(1024*1024) allocated,
2 sum(a.bytes)/(1024*1024) used, round(sum(a.bytes)/sum(b.user_bytes),4)
pct
3 from dba_extents a, dba_data_files b
4 where a.tablespace_name=b.tablespace_name
5 and
Bambi,
Your second query is wrong because all extents in a tablespace don't
necessarily belong to the same datafile. Try the query without the
aggregate functions and the GROUP BY, and you'll understand your
mistake.
HTH,
SF
Bellow, Bambi wrote:
Friends --
Why would these two queries
Odder still, I get inconsistent results. megs_allocated is always
wrong, but megs_used is right when run against one tablespace, wrong
against another:
TABLESPACE_NAMEMEGS_ALLOCATED MEGS_USEDPCT
-- -- -- --
Bambi,
I tried your sql on my test server and the used space is the same.
here are the results. The ALLOCATED and PCT are way out, I'm looking.
1 select
a.tablespace_name,megs_allocated,megs_used,round(megs_used/b.megs_allocated,2)*100
pct
2 from (select
But Stephane, I am aggregating by tablespace for both extents and for
data_files. There is nothing here that is separating out anything by
datafile. And, if I take away the GROUP BY, I lose the ability to aggregate
at all, which is the point of this...
-Original Message-
Sent: Friday,
I encountered the same issues. Also, just to make things interesting, if
you replace DBA_EXTENTS with DBA_FREE_SPACE, the number of MEGS_ALLOCATED is
different. Still wrong, mind you, but different.
None of this makes any sense to me. My bet is that I got me a bug.
Bambi.
-Original
Below is a very nice tablespace script, followed by some sample output.
Thought you might like it. I found in somewhere.
REM name: freespace.sql
REM This script is used to list database freespace, total database
REM space, largest extent, fragments and percent freespace.
REM
REM Usage
The aggregate function operates last, on a result set. Why I suggested
to suppress the GROUP BY is that then you would have seen that the
number of bytes from each datafile is returnedtoo many times.
If you have F1 and F2 associated to your database, with E1 and E2 in F1
and E3 in F2 (I hope the
]
[EMAIL PROTECTED]cc:
.com Subject: RE: SQL Query
, Bambi [EMAIL PROTECTED]
Sent by: [EMAIL PROTECTED]
11/14/2003 09:44 AM
Please respond to ORACLE-L
To:Multiple recipients of list ORACLE-L [EMAIL PROTECTED]
cc:
Subject:SQL Query
Friends --
Why would these two queries return different results?
This query works.
SQL
Ah, I see your point, now, and that's quite correct. Which means I can
either aggregate on fileid, or aggregate by table and join. Nice catch, and
mystery solved. No bug report.
Take care and have a great weekend!
Bambi.
-Original Message-
Sent: Friday, November 14, 2003 2:50 PM
To:
Jared
--
That is expected behavior for
this query. What was weird is that I expected the aggregation in the group
by to apply to multiple fileids making GROUP BY a.tablespace_name,
b.tablespace_name to be able, then, to join a.tablespace_name to
b.tablespace_name as a 1-1 join rather than
]
To: Multiple recipients of list ORACLE-L
Sent: Saturday, November 15, 2003 9:54
AM
Subject: Re: SQL Query
You can't join DBA_EXTENTS and
DBA_DATA_FILES based on an equality of
tablespace_name, and then add up the bytes of the files for the tablespace. ie. select
b.tablespace_name
:
Subject:RE: SQL Query
Jared --
That is expected behavior for this query. What was weird is that I expected the aggregation in the group by to apply to multiple fileids making GROUP BY a.tablespace_name, b.tablespace_name to be able, then, to join a.tablespace_name to b.tablespace_name as a 1-1
Sorry, don't understand the DBA part ( #2 ).
Binley Lim [EMAIL PROTECTED]
Sent by: [EMAIL PROTECTED]
11/14/2003 02:09 PM
Please respond to ORACLE-L
To:Multiple recipients of list ORACLE-L [EMAIL PROTECTED]
cc:
Subject:Re: SQL Query
Would have thought:
1
, November 15, 2003 1:19
PM
Subject: Re: SQL Query
Sorry, don't understand the
DBA part ( #2 ).
"Binley Lim" [EMAIL PROTECTED]
Sent by: [EMAIL PROTECTED]
11/14/2003 02:09 PM
Please respond to ORACLE-L
To:
I have multiple timestamps values for single ip in a table, I need the max(timestamp)for each ip I select out.
example:
timestamp ip
2003-09-29 13:20:23 68.209.182.42003-09-29 13:20:44 68.209.182.42003-10-02 12:53:38 68.209.182.42003-10-02 12:35:06 68.75.94.1582003-10-02 12:52:03 68.97.33.69
Thus
Johan,
First, you don't need the distinct. The proper query will return
1 row per ip. Second, take the max(timestamp) out of the group
by. That is causing the problem.
Daniel
Johan Muller wrote:
I have multiple timestamps values for single ip in a table, I
need the max(timestamp) for each
select ip, max(timestamp) from table
group by ip;
-Original Message-From: Johan Muller
[mailto:[EMAIL PROTECTED]Sent: Thursday, October 02, 2003 10:45
AMTo: Multiple recipients of list ORACLE-LSubject: Sql
query : select max timestamp value from table
I have multiple
Title: RE: Sql query : select max timestamp value from table
select ip, max(timestamp) from table
group by ip;
Jerry Whittle
ASIFICS DBA
NCI Information Systems Inc.
[EMAIL PROTECTED]
618-622-4145
-Original Message-
From: Johan Muller [SMTP:[EMAIL PROTECTED]
I have
PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Johan
Muller
Sent: Thursday, October 02, 2003
10:45 AM
To: Multiple recipients of list
ORACLE-L
Subject: Sql query
: select max timestamp value from table
I have multiple timestamps values for single ip
in a table, I need the max(timestamp)for each ip I
Title: Message
select
ip, max(timestamp) from table
group
by ip;
-Original Message-From: Johan Muller
[mailto:[EMAIL PROTECTED] Sent: Thursday, October 02, 2003 10:45
AMTo: Multiple recipients of list ORACLE-LSubject: Sql
query : select max timestamp value from table
Hi,
I have the following data , table Temp
ID Text Order
1 B2
1 A1
1 C3
I want to write a query which says: wherever there is more than 1 occurrence
of ID then concatenate the text in the order specified in the order column.
So i would get:
ID Text
1
Imran,
Tom Kyte has a thread that might help:
http://asktom.oracle.com/pls/ask/f?p=4950:8:1554835115460038644::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:229614022562,
Essentially, you can do this:
CREATE or replace FUNCTION CONCAT_LIST( cur SYS_REFCURSOR )
RETURN VARCHAR2 IS
ret
Mike,
Just wanted to supplement your example with another one from my
environment (uses nested tables with CAST and MULTISET to achieve the
same):
SELECT c.customer_id
,customer_name
,utils.code_table_to_string(CAST( MULTISET(
SELECT distinct dlr_dealer_code
FROM
Err, not quite, actually.
The solution presented below will simply generate the cartesian product of
the sum of attributes from the table.
The (grossly pedantic) solution is:
select distinct a.col1, a.col2, a.col3||b.col3||c.col3
from fred a, fred b, fred c
where a.col3 = 'A'
and b.col3 = 'B'
Hi,
I have the following data in a table:
col1 col2 col3
1 2 A
1 2 B
1 2 C
I want to display this as :
col1 col2 col3
1 2 A B C
How can i do this?
Regards
Imran
--
Please see the official ORACLE-L FAQ:
Assume your table is name fred:
select a.col1 a.col2 a.col3||b.col3||c.col3
from fred a, fred b, fred c;
Allan
-Original Message-
Sent: Friday, September 19, 2003 10:15 AM
To: Multiple recipients of list ORACLE-L
Hi,
I have the following data in a table:
col1 col2 col3
1
I have a table with records like this
CID S TO_CHAR(DATECREATED, MESSAGE PID
- - --
2 N 01-feb-1974 19:45:45 service change1*
3 N 01-feb-1974 19:45:45 service change
select columns from table A)
where predicates
and datecreated = (select min(datecreated)
from table b where b.cid = a.cid and b.pid = a.pid)
At 08:14 PM 6/13/2003 -0800, you wrote:
I have a table with records like this
CID S TO_CHAR(DATECREATED, MESSAGE PID
PROTECTED] On
Behalf Of gmei
Sent: 10 June 2003 22:59
To: Multiple recipients of list ORACLE-L
Subject: sql query optimization
Hi:
I have been trying for two days to see if I could optimize
this query without much success. One of the programs here
calls this query many many times
craete a another table that just has
the rows I need, I can often significantly improve performance.
From: Niall Litchfield [EMAIL PROTECTED]
Date: 2003/06/12 Thu PM 01:15:08 EDT
To: Multiple recipients of list ORACLE-L [EMAIL PROTECTED]
Subject: RE: sql query optimization
Given the low
Hi:
I have been trying for two days to see if I could optimize this query
without much success. One of the programs here calls this query many many
times and I hope I could make it run faster. It typically take about 1 sec
to get the result. I have tried using exists to replace in and the
result
ORACLE-L [EMAIL PROTECTED]
Sent by: cc:
[EMAIL PROTECTED]Subject: sql query optimization
]To: Multiple
recipients of list ORACLE-L [EMAIL PROTECTED]
Sent by: cc:
[EMAIL PROTECTED]Subject: sql query
optimization
.com
11/06/2003 07:59
Please respond
at.
Regards,
Mark.
gmei
[EMAIL PROTECTED]To: Multiple recipients of
list ORACLE-L [EMAIL PROTECTED]
Sent by: cc:
[EMAIL PROTECTED]Subject: sql query
by: cc:
[EMAIL PROTECTED]Subject: Re: sql query optimization
.com
i have a query that returns 2 rows with one column being id and the other
being date-time stamp.
i want to select the row with the latest timestamp among those two
records.they have difference id values
SELECT ID,LastModDate
FROM Tab
ID LastModDate
-- ---
2 1/20/2003
Add group by ID; as in:
SELECT ID,MAX(LastModDate) FROM Tab
group by ID;
-Original Message-
From: Basavaraja, Ravindra [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 28, 2003 8:15 PM
To: Multiple recipients of list ORACLE-L
Subject: SQL Query Help
i have a query that returns
:
[EMAIL PROTECTED] Subject: SQL Query Help
recipients of list ORACLE-L
Subject: SQL Query Help
i have a query that returns 2 rows with one column being id
and the other
being date-time stamp.
i want to select the row with the latest timestamp among those two
records.they have difference id values
SELECT ID,LastModDate
FROM Tab
]
Sent by: cc:
[EMAIL PROTECTED] Subject: SQL Query Help
;
-Original Message-
From: Basavaraja, Ravindra [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 28, 2003 8:15 PM
To: Multiple recipients of list ORACLE-L
Subject: SQL Query Help
i have a query that returns 2 rows with one column being id
and the other
being date-time stamp.
i want to select the row
: Re: SQL Query Help
[EMAIL PROTECTED
Reddy
There are a variety of techniques to accomplish this, and it is difficult
to determine which will work best in your situation. Here is a link to a
classic article on this topic by the great Jonathan Gennick who participates
in this list from time to time.
Using the EMP table as an example I want to create a query that will show a
list of employees and the mgrs above them. Like this:
ENAME MGRS
--- --
SMITH SMITH
SMITH FORD
SMITH JONES
SMITH KING
ALLEN
Hello
9i (ORA-01489! be aware):
SELECT LTRIM(SUBSTR(SYS_CONNECT_BY_PATH(RPAD(ename, 20, ' '), '/'), 2, 19)) ename
, ename mgrs
FROM emp
CONNECT BY PRIOR mgr = empno
/
Eberhard, Jeff wrote:
Using the EMP table as an example I want to create a query that will show a
list of employees and
Vladimir Begun wrote:
SELECT LTRIM(SUBSTR(SYS_CONNECT_BY_PATH(RPAD(ename, 20, ' '), '/'), 2,
typo: ^RTRIM
--
Vladimir Begun
The statements and opinions expressed here are my own and
do not necessarily represent those of Oracle Corporation.
--
Please see the official ORACLE-L FAQ:
hi,
i have a table with indent number and quantity with 10 rows
ex ind_no qty
1 10
1 12
1 30
1 15
1 30
2 12
2 30
2
, Ravindra
Sent: Tuesday, March 11, 2003 12:19 PM
To: 'Multiple recipients of list ORACLE-L'
Subject: sql query: to_date() :ORA-01830: date format picture ends before
converting entire input string
Hi...
I am getting the following error with a query like this
select * from cust
Hi...
I am getting the following error with a query like this
select * from cust where
to_char(DATECREATED,'DD-MON-YYY HH24:MI:SS') =
to_date('01-FEB-03 07:53:28','DD-MON-YY HH24:MI:SS')
ORA-01830: date format picture ends before converting entire input string
What is the problem?
Thanks
--
Title: RE: sql query: to_date() :ORA-01830: date format picture ends before
Why are you comparing a date to a char?
select *
from cust
where to_char(DATECREATED,'DD-MON-YYY HH24:MI:SS') = '01-FEB-03 07:53:28'
/
should work it appears that your NLS_DATE_FORMAT kicked in when your
What's the to_char for?
try
select * from cust where
DATECREATED = to_date('01-FEB-03 07:53:28','DD-MON-YY HH24:MI:SS')
-Original Message-
Sent: Tuesday, March 11, 2003 12:20 PM
To: Multiple recipients of list ORACLE-L
before
Hi...
I am getting the following error with a query like
You are comparing CHAR to DATE, you would need one of the following
conditions
1- where DATECREATED = to_date('01-FEB-03 07:53:28','DD-MON-YY HH24:MI:SS')
2- where to_char(DATECREATED,'DD-MON-YYY HH24:MI:SS') = '01-FEB-03 07:53:28'
to be able to complete the WHERE clause
Rick Weiss
Oracle DBA
Basavaraja, Ravindra wrote:
Hi...
I am getting the following error with a query like this
select * from cust where
to_char(DATECREATED,'DD-MON-YYY HH24:MI:SS') =
to_date('01-FEB-03 07:53:28','DD-MON-YY HH24:MI:SS')
ORA-01830: date format picture ends before converting entire input
Why are trying to compare date to string: to_char(...) = to_date(...) ?
Igor Neyman, OCP DBA
[EMAIL PROTECTED]
- Original Message -
To: Multiple recipients of list ORACLE-L [EMAIL PROTECTED]
Sent: Tuesday, March 11, 2003 3:20 PM
Hi...
I am getting the following error with a
Hello Ravindra,
You should use to_char OR to_data not both.
select * from cust where
to_char(DATECREATED,'DD-MON-YYY HH24:MI:SS') = '01-FEB-03 07:53:28'
Wednesday, March 12, 2003, 2:20:17 AM, you wrote:
BR Hi...
BR I am getting the following error with a query like this
BR select * from cust
!
Aleem
-Original Message-
Sent: Wednesday, March 12, 2003 1:20 AM
To: Multiple recipients of list ORACLE-L
Subject:sql query: to_date() :ORA-01830: date format picture ends
before
Hi...
I am getting the following error with a query like this
select * from cust where
I have this sql query. I am wondering why this query takes so long time, Do I need
more conditions to make it run, or it it just that this query take so long time to
run? Anything wrong with the query?
Please help me with this.
SELECT distinct PBK.VARUKORGEANREL_ULAG.ean, 0, 0, 0, rik2
of your query, there are 6 tables, whereas in the WHERE
clause there is only 1 join condition.
HTH.
Regards,
Charu
-Original Message-
[EMAIL PROTECTED]
Sent: Wednesday, February 05, 2003 6:24 PM
To: Multiple recipients of list ORACLE-L
I have this sql query. I am wondering why this query
[EMAIL PROTECTED]
Sent: Wednesday, February 05, 2003 9:52 AM
I have this sql query. I am wondering why this query takes so long time,
Do I need more conditions to make it run, or it it just that this query take
so long time to run? Anything wrong with the query?
Please help me
Roland,
A quick look suggest you have cartesian joins unless rik2.vare,
rik2.hierarki_tekst, rik2.art_hierarki, pbk.sortiment_vgrp all have only one
row.
Iain Nicoll
-Original Message-
Sent: 05 February 2003 14:53
To: Multiple recipients of list ORACLE-L
I have this sql query. I am
To: Multiple recipients of list ORACLE-L
Subject: Sql query
I have this sql query. I am wondering why this query takes so long time,
Do I need more conditions to make it run, or it it just that this query
take so long time to run? Anything wrong with the query?
Please help me
Hi all,
How do I forumlate the below query without using the UNION clause?
SELECT H1.OID HISTORIEOID,FAHRZEUG.AMTLICHESKENNZEICHEN,
FAHRZEUG.OID,
H1.PRODUKT,H1.AUFTRAGSPOSITIONSNR,H1.MYTECHOBJEKT
FROM FAHRZEUG,HISTORIE H1
WHERE FAHRZEUG.OID = H1.MYTECHOBJEKT(+)
AND
You would be surprised to discover what you could do with OR and suitably placed
parentheses.
- Original Message -
From: Krishnaswamy, Ranganath
[EMAIL PROTECTED]
To: Multiple recipients of list ORACLE-L
[EMAIL PROTECTED]
Sent: Wed, 18 Dec 2002 23:53:44
Hi all,
How do I forumlate the
Try this,
SELECT DISTINCT H1.OID HISTORIEOID,FAHRZEUG.AMTLICHESKENNZEICHEN,
FAHRZEUG.OID,
H1.PRODUKT,H1.AUFTRAGSPOSITIONSNR,H1.MYTECHOBJEKT
FROM FAHRZEUG,HISTORIE H1
WHERE FAHRZEUG.OID = H1.MYTECHOBJEKT(+)
AND
((TO_DATE(H1.DATUMSTR,'-MM-DD') = (select
max(TO_DATE(H1.DATUMSTR,'-mm-dd'))
I think you can translate it as OR, but you have to use some DISTINCT on
output rows (because you use UNION and not UNION ALL).
Without DISTINCT it is like:
SELECT
H1.OID HISTORIEOID
,FAHRZEUG.AMTLICHESKENNZEICHEN
,FAHRZEUG.OID
,H1.PRODUKT
,H1.AUFTRAGSPOSITIONSNR
,H1.MYTECHOBJEKT
FROM FAHRZEUG,
Ranganath,
Apologies my reply directly to yourself got bounced for some reason.
A couple of questions. How good a filter is the
ZPAA.AUFTRAGSPOSITION.TAGESABSCHLUSSNUMMER = :TAGESABSCHLUSSNUMMER
line. And is the subquery done simply to ensure no duplicates.
Generally you want to drive
Hi all,
I have the following query which is running slow and doing
full table scan on DIENSTLEISTUNGSOBJEKT and FZGBRIEF tables. I have
created all the neccessary indexes on these two tables apart from other
tables. In this regard I request you to help me in tuning the
In the explain plan's first line
SELECT STATEMENT Hint=HINT: RULE
But i don't see any rule hint in the SQL statement you have sent.
Analyze the tables/indexes, use a choose hint and run the SQL plan again.
What version you are on? what is the value of optimizer_mode, optimizer_goal
Regards
sql server 7???
and you are trying to find an answer on Oracle
board?
Igor Neyman, OCP DBA[EMAIL PROTECTED]
- Original Message -
From:
Santosh
Varma
To: Multiple recipients of list ORACLE-L
Sent: Friday, October 04, 2002 2:23
AM
Subject: RE: Sql query
HELP!
-Original Message-
Sent: 04 October 2002 14:53
To: Multiple recipients of list ORACLE-L
sql server 7???
and you are trying to find an answer on Oracle board?
Igor Neyman, OCP DBA
[EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
- Original Message -
To: Multiple
ARE YOU AN IDIOT
-Original Message-
Sent: 04 October 2002 16:13
To: Multiple recipients of list ORACLE-L
HELP!
-Original Message-
Sent: 04 October 2002 14:53
To: Multiple recipients of list ORACLE-L
sql server 7???
and you are trying to find an answer on Oracle board?
Obligatory...
ARE YOU AN IDIOT?
-Original Message-
Sent: Friday, October 04, 2002 11:13 AM
To: Multiple recipients of list ORACLE-L
HELP!
-Original Message-
Sent: 04 October 2002 14:53
To: Multiple recipients of list ORACLE-L
sql server 7???
and you are trying to find an
HELP!
is this also sql server 7 command? :-)
Igor Neyman, OCP DBA
[EMAIL PROTECTED]
- Original Message -
To: Multiple recipients of list ORACLE-L [EMAIL PROTECTED]
Sent: Friday, October 04, 2002 11:13 AM
HELP!
-Original Message-
Sent: 04 October 2002 14:53
To:
Are you an idiot?
- Original Message -
To: Multiple recipients of list ORACLE-L [EMAIL PROTECTED]
Sent: Friday, October 04, 2002 11:13 AM
HELP!
-Original Message-
Sent: 04 October 2002 14:53
To: Multiple recipients of list ORACLE-L
sql server 7???
and you are
ARE YOU AN IDIOT! ;o)
-Original Message-
Sent: Friday, October 04, 2002 10:13 AM
To: Multiple recipients of list ORACLE-L
HELP!
-Original Message-
Sent: 04 October 2002 14:53
To: Multiple recipients of list ORACLE-L
sql server 7???
and you are trying to find an answer on
I have a table test((NAME
VARCHAR2(10),AGE NUMBER(2));
data of the table is
NAME
AGE--
-ANAND
1BALU2CHANDU3DAVID4
I want a query which give
me the result as
NAME
AGE--
-ANAND
4BALU3CHANDU2DAVID1
Can any body pl. help me.
Anand KumarITW
3 ïËÔÑÂÒØ 2002 12:03, ÷Ù ÎÁÐÉÓÁÌÉ:
I have a table test((NAME VARCHAR2(10),AGE NUMBER(2));
data of the table is
NAME AGE
-- -
ANAND 1
BALU 2
CHANDU3
DAVID4
I want a query
cannot perform an aggregate function on an expression containing an
aggregate or subquery
is the error i am getting while i am executing the query.
SELECT name
FROM (SELECT c.name, COUNT(p.clientid) p_count
FROM client c, project p
WHERE c.clientid = p.clientid
GROUP BY c.name) a,
(SELECT
why do
u want such a query?
-Original Message-From: Anand Kumar N
[mailto:[EMAIL PROTECTED]]Sent: Thursday, October 03, 2002
1:33 PMTo: Multiple recipients of list ORACLE-LSubject:
SQL Query
I have a table
test((NAME VARCHAR2(10),AGE NUMBER(2));
data of the table
TRY THIS :
SELECT NAME, 4-AGE+1 FROM test;
--- Naveen Nahata [EMAIL PROTECTED] wrote:
why do u want such a query?
-Original Message-
Sent: Thursday, October 03, 2002 1:33 PM
To: Multiple recipients of list ORACLE-L
I have a table test((NAME VARCHAR2(10),AGE
NUMBER(2));
the below query adds/substracts the value in the age column...
SELECT NAME, 4-AGE+1 FROM test;
does not work..
-Original Message-
SALAYMEH
Sent: Thursday, October 03, 2002 5:28 PM
To: Multiple recipients of list ORACLE-L
TRY THIS :
SELECT NAME, 4-AGE+1 FROM test;
--- Naveen Nahata
Santosh,
If you could tell why do you want the ages be reversed?
Aleem
-Original Message-
Sent: Thursday, October 03, 2002 5:35 PM
To: Multiple recipients of list ORACLE-L
Subject:RE: SQL Query
the below query adds/substracts the value in the age column...
SELECT NAME
huh?
new value
ANAND 1 4-1+1 = 4
BALU 2 4-2+1 = 3
CHANDU 3 4-3+1 = 2
DAVID 4 4-4+1 = 1
looks right to me.
Tom Mercadante
Oracle Certified Professional
-Original Message-
Sent: Thursday, October
Santosh,
Till now you haven't exactly specified what you want and WHY you want such a
thing.
So I can only make a guess at what you want. If you want the age of the last
record to be shown with the name of the first record and so on, then
following is the query:
SQL SELECT * FROM test;
NAME
: Sql
query
cannot perform an aggregate function on an expression containing an
aggregate or subquery
is the error i am getting while i am executing the query.
SELECT name
FROM (SELECT c.name, COUNT(p.clientid) p_count
FROM client c, project p
WHERE c.clientid = p.clientid
GROUP
]]On Behalf Of Naveen NahataSent:
Thursday, October 03, 2002 9:03 PMTo: Multiple recipients of list
ORACLE-LSubject: RE: Sql query
Santosh,
your
query is working. See below
SQL CREATE TABLE CLIENT ( 2 CLIENTID NUMBER PRIMARY
KEY, 3 NAME VARCHAR2(10) 4
);
Table created
PM
To: Multiple recipients of list ORACLE-L
DENNIS WILLIAMS wrote:
I am trying to tune a SQL query on Oracle 8.1.6. I have tried several
optimizations, but
so far have made no improvements. I would appreciate any suggestions.
SELECT am.lid, am.name
FROM am, so, sa
WHERE so.lid = am.lid
I am trying to tune a SQL query on Oracle 8.1.6. I have tried several
optimizations, but
so far have made no improvements. I would appreciate any suggestions.
SELECT am.lid, am.name
FROM am, so, sa
WHERE so.lid = am.lid
AND so.key_ = sa.so_key
AND am.active = 1
AND so.code = 11
AND sa.ret = 'SB
to through in an
use_nl also.
Iain Nicoll
-Original Message-
Sent: Tuesday, September 10, 2002 8:19 PM
To: Multiple recipients of list ORACLE-L
I am trying to tune a SQL query on Oracle 8.1.6. I have tried several
optimizations, but
so far have made no improvements. I would appreciate any
DENNIS WILLIAMS wrote:
I am trying to tune a SQL query on Oracle 8.1.6. I have tried several
optimizations, but
so far have made no improvements. I would appreciate any suggestions.
SELECT am.lid, am.name
FROM am, so, sa
WHERE so.lid = am.lid
AND so.key_ = sa.so_key
AND am.active = 1
:
Subject:SQL Query tuning help
I am trying to tune a SQL query on Oracle 8.1.6. I have tried several
optimizations, but
so far have made no improvements. I would appreciate any suggestions.
SELECT am.lid, am.name
FROM am, so, sa
WHERE so.lid = am.lid
AND so.key_ = sa.so_key
1 - 100 of 224 matches
Mail list logo