SQL Query Problem(possilble duplicate send, Sorry!)

2004-01-13 Thread Viktor
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

Re: SQL Query Problem(possilble duplicate send, Sorry!)

2004-01-13 Thread Bricklen Anderson
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

Re: SQL Query Problem(possilble duplicate send, Sorry!)

2004-01-13 Thread Viktor
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

Re: SQL Query Problem(possilble duplicate send, Sorry!)

2004-01-13 Thread Bricklen Anderson
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:

RE: SQL Query Problem(possilble duplicate send, Sorry!)

2004-01-13 Thread Rohan Karanjawala
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

SQL Query

2003-11-14 Thread Bellow, Bambi
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

Re: SQL Query

2003-11-14 Thread Ron Rogers
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

RE: SQL Query

2003-11-14 Thread Bellow, Bambi
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

Re: SQL Query

2003-11-14 Thread Stephane Faroult
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

RE: SQL Query

2003-11-14 Thread Paul Baumgartel
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 -- -- -- --

RE: SQL Query

2003-11-14 Thread Ron Rogers
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

RE: SQL Query

2003-11-14 Thread Bellow, Bambi
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,

RE: SQL Query

2003-11-14 Thread Bellow, Bambi
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

RE: SQL Query

2003-11-14 Thread Smith, Ron L.
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

Re: SQL Query

2003-11-14 Thread Stephane Faroult
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

RE: SQL Query

2003-11-14 Thread Ron Thomas
] [EMAIL PROTECTED]cc: .com Subject: RE: SQL Query

Re: SQL Query

2003-11-14 Thread Jared . Still
, 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

RE: SQL Query

2003-11-14 Thread Bellow, Bambi
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:

RE: SQL Query

2003-11-14 Thread Bellow, Bambi
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

Re: SQL Query

2003-11-14 Thread Binley Lim
] 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

RE: SQL Query

2003-11-14 Thread Jared . Still
: 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

Re: SQL Query

2003-11-14 Thread Jared . Still
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

Re: SQL Query

2003-11-14 Thread Binley Lim
, 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:

Sql query : select max timestamp value from table

2003-10-02 Thread Johan Muller
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

Re: Sql query : select max timestamp value from table

2003-10-02 Thread Daniel Fink
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

RE: Sql query : select max timestamp value from table

2003-10-02 Thread Khedr, Waleed
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

RE: Sql query : select max timestamp value from table

2003-10-02 Thread Whittle Jerome Contr NCI
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

RE: Sql query : select max timestamp value from table

2003-10-02 Thread Melanie Caffrey
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

RE: Sql query : select max timestamp value from table

2003-10-02 Thread Rothouse, Michael
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

SQL Query

2003-09-25 Thread Imran Ashraf
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

Re: SQL Query

2003-09-25 Thread Mike Spalinger
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

Re: SQL Query

2003-09-25 Thread sundeep maini
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

RE: SQL Query

2003-09-22 Thread Robson, Peter
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'

SQL Query

2003-09-19 Thread Imran Ashraf
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:

RE: SQL Query

2003-09-19 Thread Nelson, Allan
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

SQL Query Help

2003-06-13 Thread Basavaraja, Ravindra
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

Re: SQL Query Help

2003-06-13 Thread Wolfgang Breitling
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

RE: sql query optimization

2003-06-12 Thread Niall Litchfield
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

Re: RE: sql query optimization

2003-06-12 Thread rgaffuri
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

sql query optimization

2003-06-10 Thread gmei
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

Re: sql query optimization

2003-06-10 Thread Mark Richard
ORACLE-L [EMAIL PROTECTED] Sent by: cc: [EMAIL PROTECTED]Subject: sql query optimization

Re: sql query optimization

2003-06-10 Thread Binley Lim
]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

Re: sql query optimization

2003-06-10 Thread Guang Mei
at. Regards, Mark. gmei [EMAIL PROTECTED]To: Multiple recipients of list ORACLE-L [EMAIL PROTECTED] Sent by: cc: [EMAIL PROTECTED]Subject: sql query

Re: sql query optimization

2003-06-10 Thread Mark Richard
by: cc: [EMAIL PROTECTED]Subject: Re: sql query optimization .com

SQL Query Help

2003-05-29 Thread Basavaraja, Ravindra
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

RE: SQL Query Help

2003-05-29 Thread Murray, Margaret
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

Re: SQL Query Help

2003-05-29 Thread Reginald . W . Bailey
: [EMAIL PROTECTED] Subject: SQL Query Help

RE: SQL Query Help

2003-05-29 Thread Basavaraja, Ravindra
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

RE: SQL Query Help

2003-05-29 Thread Basavaraja, Ravindra
] Sent by: cc: [EMAIL PROTECTED] Subject: SQL Query Help

Re: SQL Query Help

2003-05-29 Thread Daniel W. Fink
; -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

2003-05-29 Thread Mark Richard
: Re: SQL Query Help [EMAIL PROTECTED

RE: sql query

2003-03-31 Thread DENNIS WILLIAMS
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.

SQL Query -- List of managers

2003-03-31 Thread Eberhard, Jeff
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

Re: SQL Query -- List of managers

2003-03-31 Thread Vladimir Begun
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

Re: SQL Query -- List of managers

2003-03-31 Thread Vladimir Begun
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:

sql query

2003-03-30 Thread sudhakar Reddy
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

RE: sql query: to_date() :ORA-01830: date format picture ends bef

2003-03-11 Thread Basavaraja, Ravindra
, 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

sql query: to_date() :ORA-01830: date format picture ends before

2003-03-11 Thread Basavaraja, Ravindra
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 --

RE: sql query: to_date() :ORA-01830: date format picture ends bef

2003-03-11 Thread Jamadagni, Rajendra
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

RE: sql query: to_date() :ORA-01830: date format picture ends bef

2003-03-11 Thread Richard Ji
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

RE: sql query: to_date() :ORA-01830: date format picture ends bef

2003-03-11 Thread Weiss, Rick
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

Re: sql query: to_date() :ORA-01830: date format picture ends before

2003-03-11 Thread Stephane Faroult
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

Re: sql query: to_date() :ORA-01830: date format picture ends before

2003-03-11 Thread Igor Neyman
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

Re: sql query: to_date() :ORA-01830: date format picture ends before

2003-03-11 Thread Sergey V Dolgov
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

RE: sql query: to_date() :ORA-01830: date format picture ends bef

2003-03-11 Thread Abdul Aleem
! 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

Sql query

2003-02-05 Thread roland . skoldblom
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

RE: Sql query

2003-02-05 Thread Charu Joshi
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

Re: Sql query

2003-02-05 Thread Igor Neyman
[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

RE: Sql query

2003-02-05 Thread Nicoll, Iain
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

RE: Sql query

2003-02-05 Thread Sony kristanto
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

SQL query without UNION clause

2002-12-19 Thread Krishnaswamy, Ranganath
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

RE: SQL query without UNION clause

2002-12-19 Thread Stephane Faroult
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

RE: SQL query without UNION clause

2002-12-19 Thread Naveen Nahata
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'))

Re: SQL query without UNION clause

2002-12-19 Thread Jan Pruner
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,

RE: Problem with SQL query

2002-12-17 Thread Nicoll, Iain
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

Problem with SQL query

2002-12-16 Thread Krishnaswamy, Ranganath
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

RE: Problem with SQL query

2002-12-16 Thread Naveen Nahata
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

Re: Sql query

2002-10-04 Thread Igor Neyman
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

RE: Sql query

2002-10-04 Thread Thomas, Kevin
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

RE: Sql query

2002-10-04 Thread Robertson Lee - lerobe
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?

RE: Sql query

2002-10-04 Thread Mercadante, Thomas F
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

Re: Sql query

2002-10-04 Thread Igor Neyman
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:

Re: Sql query

2002-10-04 Thread Ruth Gramolini
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

RE: Sql query

2002-10-04 Thread Farnsworth, Dave
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

SQL Query

2002-10-03 Thread Anand Kumar N
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

Re: SQL Query

2002-10-03 Thread Mikhail Ivanov
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

Sql query

2002-10-03 Thread Santosh Varma
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

RE: SQL Query

2002-10-03 Thread Naveen Nahata
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

RE: SQL Query

2002-10-03 Thread ASHRAF SALAYMEH
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));

RE: SQL Query

2002-10-03 Thread Santosh Varma
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

RE: SQL Query

2002-10-03 Thread Abdul Aleem
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

RE: SQL Query

2002-10-03 Thread Mercadante, Thomas F
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

RE: SQL Query

2002-10-03 Thread Naveen Nahata
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

RE: Sql query

2002-10-03 Thread Naveen Nahata
: 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

RE: Sql query

2002-10-03 Thread Santosh Varma
]]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

RE: SQL Query tuning help

2002-09-12 Thread DENNIS WILLIAMS
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

SQL Query tuning help

2002-09-10 Thread DENNIS WILLIAMS
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

RE: SQL Query tuning help

2002-09-10 Thread Nicoll, Iain \(Calanais\)
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

Re: SQL Query tuning help

2002-09-10 Thread Stephane Faroult
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

Re: SQL Query tuning help

2002-09-10 Thread Jared . Still
: 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   2   3   >