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: Ed prochak <ed.prochak_at_magicinterface.com>
Date: 20 Feb 2004 09:29:44 -0800
Message-ID: <4b5394b2.0402200929.e094b3d@posting.google.com>


Vince <vince_at_nospam.net.invalid> wrote in message news:<40351a9d$0$22377$626a14ce_at_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.
>

yes google still allows that group.

> >>" 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.
>

I only asked because yuou had both title AND person in the SELECT clause, making the DISTINCT seem less useful. And besides, I always think it discards information. for an adhoc query I'd always choose:

select count(*),title

   over
select distinct title

But that's just me.

[]

> > 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!

So you aren't using SQL*Plus? Only thing I can suspect is the semicolon (;) which is needed in SQL/Plus (and in the SQL standard, except for embedded or dynamic SQL).

Enjoy learning!
  Ed Received on Fri Feb 20 2004 - 11:29:44 CST

Original text of this message

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