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: HELP with SQL

Re: HELP with SQL

From: <akchittanuri_at_gmail.com>
Date: 11 Nov 2005 02:51:01 -0800
Message-ID: <1131706261.589261.200600@z14g2000cwz.googlegroups.com>


Michael,
1) execution of the query

select a.ctry_name, b.city_name,

             row_number() over (partition by a.ctry_name, b.city_name) rn

      from country a, city b where a.ctry_id = b.ctry_id

gave the error...

ORA-30485: missing ORDER BY expression in the window specification

2) execution of the query

select a.ctry_name, b.city_name,

             row_number() over (order by a.ctry_name, b.city_name) rn
      from country a, city b where a.ctry_id = b.ctry_id

gave the output

CTRY_NAME                      CITY_NAME
RN
------------------------------ ------------------------------

Canada                         Ottawa
1
Canada                         Toronto
2
India                          Mumbai
3
USA                            New York
4
USA                            Phoenix
5
USA                            Washington
6
6 rows selected

IN the query(1), as i missing anything????

Thanks,
Anand. Received on Fri Nov 11 2005 - 04:51:01 CST

Original text of this message

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