Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

Order By... in a Join

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Order By... in a Join

    What occurs to me: 1. Check the Query Optimizer messages - maybe it'll suggest an index that would work. 2. Create the resultset as a table, then sort the table. CREATE TABLE sometable AS (your sql statement) WITH DATA SELECT * FROM sometable ORDER BY somefield

  • #2
    Order By... in a Join

    Hello, I've created an SQL query that joins a few files. Everything works fine but I would like to order the resultset by a field that is one of the joined tables. When I add the "order by" clause at the end of the query, performance takes a severe hit. Basically, what I would like SQL to do is order the resultset after the resultset is created. Maybe that's not possible, but does anyone have ideas on how to get this to work?

    Comment


    • #3
      Order By... in a Join

      I don't have a lot of the details handy, but this can be a great help when trying to diagnose SQL performance. If you use the explain function, it will show you graphically each step used to process your SQL statement. you can get even more detail by clicking on a specific step or sometimes even just by hovering your mouse near it.

      Comment

      Working...
      X