Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8478995
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T18:54:10+00:00 2026-06-10T18:54:10+00:00

Possible Duplicate: How do I limit the number of rows returned by an Oracle

  • 0

Possible Duplicate:
How do I limit the number of rows returned by an Oracle query after ordering?

I am using just like below query:

SELECT url, title, metadesc FROM (
        SELECT url,title, metadesc, rownum rn FROM (
                SELECT url, title, metadesc FROM web
            )
            WHERE rownum <= 60
    )
    WHERE rn > 50

it works fine for single table but if do join in my main query
i.e

SELECT name, id, url, title, metadesc
FROM web, emp

then it gives me error:

java.sql.SQLException: ORA-00918: column ambiguously defined
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T18:54:12+00:00Added an answer on June 10, 2026 at 6:54 pm

    Use either aliases:

    SELECT e.name, e.id, w.url, w.title, w.metadesc
      FROM web w
      JOIN emp e ON w.xx = e.yy
    

    Or full table names (more verbose):

    SELECT emp .name, emp .id, web.url, web.title, web.metadesc
      FROM web
      JOIN emp ON web.xx = emp .yy
    

    If a subquery returns two columns with the same name, you can’t do a SELECT *:

    SQL> SELECT * FROM (
      2     SELECT d1.dummy, d2.dummy
      3       FROM dual d1, dual d2
      4  );
    
    ERROR at line 1:
    ORA-00918: column ambiguously defined
    

    In that case use different column names in the subquery with aliases:

    SQL> SELECT * FROM (
      2     SELECT d1.dummy dummy_d1, d2.dummy dummy_d2
      3       FROM dual d1, dual d2
      4  );
    
    D D
    - -
    X X
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: How do I limit the number of rows returned by an oracle
Possible Duplicate: How do I limit the number of rows returned by an oracle
Possible Duplicate: PHP PDO bindValue in LIMIT $number=8; try { $topics=$dbh->prepare(SELECT * FROM topictable
Possible Duplicate: Limit file format when using <input type=file>? I need to use the
Possible Duplicate: How to format a decimal How can I limit my decimal number
Possible Duplicate: JavaScript: formatting number with exactly two decimals How do I limit the
Possible Duplicate: Mysql Offset Infinite rows Is it possible to specify a query in
Possible Duplicate: SQL - how to SELECT multiple tables and JOIN multiple rows from
Possible Duplicate: How do I add a limit to update-query in Zend Framework? I
Possible Duplicate: 2GB limit on file size when using fwrite in C? I realized

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.