Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

I am trying to get sample data of 100 records from database...but the moment i add rownum in the que

nkandwalJun 19 2014 — edited Jun 19 2014

SELECT C.NAME1 NAME,

  CA.CITY CITY,

  CA.STATE STATE,

  CA.PHONE PHONE

FROM PS_CUSTOMER C,

  PS_CUST_ADDRESS CA

WHERE C.CUST_ID       = CA.CUST_ID

AND CA.CITY          IS NOT NULL

AND LENGTH(CA.CITY)  != 1

AND CA.PHONE         IS NOT NULL

AND LENGTH(CA.PHONE) != 1

AND c.rownum          < = 100

i get error

ORA-01747: invalid user.table.column, table.column, or column specification

01747. 00000 -  "invalid user.table.column, table.column, or column specification"

*Cause:   

*Action:

Error at Line: 16 Column: 6 (in red above)

then i tried something like

SELECT *

FROM

  (SELECT C.NAME1 NAME,

    CA.CITY CITY,

    CA.STATE STATE,

    CA.PHONE PHONE

  FROM PS_CUSTOMER C,

    PS_CUST_ADDRESS CA

  WHERE C.CUST_ID       = CA.CUST_ID

  AND CA.CITY          IS NOT NULL

  AND LENGTH(CA.CITY)  != 1

  AND CA.PHONE         IS NOT NULL

  AND LENGTH(CA.PHONE) != 1

  ) a

WHERE a.rownum < = 100 (in red above)

but i get the error as follows

ORA-01747: invalid user.table.column, table.column, or column specification

01747. 00000 -  "invalid user.table.column, table.column, or column specification"

*Cause:   

*Action:

Error at Line: 19 Column: 8

the other thing I wanted to ask was can i see the tables listed in sql navigator of SQL DEVELOPER

SELECT * FROM ALL_OBJECTS WHERE OBJECT_TYPE ='TABLE' AND OBJECT_NAME LIKE '%CUST%'  ( I get the tables that i need from my query as they are not visible to me in sqldeveloper )

SELECT * FROM PS_CUST_ADDRESS   ( I am able to see data)

SELECT * FROM PS_CUSTOMER   ( I am able to see data)

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 17 2014
Added on Jun 19 2014
5 comments
1,009 views