Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Problem with some SQL queries
Douglas,
> To solve this, I should have added the following restriction to the outer
> query:
> HAVING MAX( seq ) > 1
>
> This will only select rows that have at least two occurrences of the same
> values for SURNAME and FORENAMES because rows with only one occurrence of a
> particular combination of SURNAME and FORENAMES will not have a value of SEQ
> greater than 1
It works. Indeed, I should try to extract from my rows only those with two occurrences by using having. When you are focused into a certain problem, simple solution are sometimes not so easy to find. Thanks.
>>>COLUMN seq NOPRINT >> >>When I put "column teachers.seq noprint " before my query, a have the >>following error: "SQL error: ORA-00900: invalid SQL statement". In fact, >>I use Oracle as the DBMS and SQL is based on SQL/92. I will study it.
> When I enter SQL*Plus, I get the following output because I am running
> Oracle 9.2 on WinXP:
> C:\>sqlplus test_user_at_testsrvr
> Could you post what you get by using similar commands?
In fact, I am using SQL and not SQL*Plus. It is another person who manage the database. I would prefer to manage my own database, but it's not possible.
To use a certain column (seq here) with "order by" and not to display it, I simply delete this column in the "select" but by deleting also "distinct" in the select which was in fact not useful and prevented what I wanted.
Sorry to disturb you with stupid stuffs.
Douglas, sincerely, thanks a lot. Received on Thu Feb 19 2004 - 18:19:44 CST
![]() |
![]() |