Jump to content

Search the Community

Showing results for tags 'SQL ERROR'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 1 result

  1. Hi, That tutorial says that the SQL SELECT TOP equivalent in Oracle is "where rownum <= number". This is not the case, because as soon as you are using an "order by" clause (and most of the time, selecting top rows without sorting them first is meaningless), the returned rows are not the top ones, they are pseudo-randomly selected and the "order by" is only applied after that selection has occurred. After a bit of reading, the correct Oracle equivalent to : SELECT TOP number column_name(s)FROM table_nameORDER BY order_clause; is not : SELECT column_name(s)FROM table_nameWHERE ROWNUM <= numberORDER BY order_clause; it a nested query of the form : SELECT * FROM ( SELECT column_name(s) FROM table_name ORDER BY order_clause) WHERE ROWNUM <= number; I guess that it should be indicated because it's a real trap that can go unnoticed. I know it, because I fell into it :-) Best regards, Vincent PS: Note that the "limit" syntax in MySQL does not have that issue
×
×
  • Create New...