Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Fw: Problem with some SQL queries

Re: Fw: Problem with some SQL queries

From: Vince <vince_at_nospam.net.invalid>
Date: Thu, 19 Feb 2004 20:20:44 +0000
Message-ID: <40351a9d$0$22377$626a14ce@news.free.fr>


Ed,

> Since you went to the trouble of posting in the right place I'll
> answer, even though Hans answereed you in the defunct group.

In fact, my first post about my problems was posted in comp.databases.oracle with google which takes several hours to display it, instead of 1 second with a newsreader. But, it was not possible to subscribe to comp.databases.oracle (on the newsgroups' server of the FAI I chose) by using Thunderbird. That's why I posted my problems in comp.databases.oracle.misc in order to react quickly to it.

Sorry Hans.

>>" select distinct person, title from people where title is null or >>title is not null "

> But why are you using DISTINCT??

I only want a list of the different types of titles and not a big list with same titles. It is now perfect, Douglas helps me.

> convert NULL to a value that COUNT() will use. The function for this
> is NVL(), the null value function. So
> select count( distinct NVL(title,'No Title') from people ;
> will work.
> just to convince youself, try running:
> select distinct NVL(title,'No Title' from people ;

Indeed, it works !

> This is one of VERY FEW casees where the ROWID pseudocolumn is useful.
> modifying your first version like this:
> select * from people as p, people as pp where
> p.surname=pp.surname AND p.ROWID <> pp.ROWID ;
> should get you on your way to success.

Sorry, but I get "SQL error: ORA-00933: SQL command not properly ended".   As I posted in another message, my SQL/92 is very curious and seems not to accept some kind of queries, as "column ... no print". Strange, isn't it! Received on Thu Feb 19 2004 - 14:20:44 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US