Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Sorting SQL results

by sundialsvc4 (Monsignor)
on Oct 15, 2013 at 03:35 UTC ( #1058234=note: print w/ replies, xml ) Need Help??


in reply to Sorting SQL results

My general suggestion is that you should always use ORDER BY in your SQL statement, so that you specify the ordering that you require, if you care at all about the order.   Otherwise, the ordering of rows in any SQL query is defined to be:   “unpredictable.”   It can vary from query to query, and it certainly can be expected to vary as the table-size grows.


Comment on Re: Sorting SQL results
Re^2: Sorting SQL results
by roboticus (Canon) on Oct 15, 2013 at 10:22 UTC

    sundialsvc4:

    The ORDER BY clause tells the database to sort the rows into order. The OP had difficulty getting the columns in the correct order.

    While the title of the post does suggest that an ORDER BY clause may be appropriate, sometimes you need to read the body of the post in order to compose a relevant reply.

    ...roboticus

    When your only tool is a hammer, all problems look like your thumb.

      Does his question involve the table format too?
      use Text::ASCIITable;
      Maybe be part of the solution....

        spandox:

        The Text::ASCIITable package may be involved in his solution, but based on the text and the title, it looked like his primary problem was with the column ordering.

        ...roboticus

        When your only tool is a hammer, all problems look like your thumb.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1058234]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (21)
As of 2014-09-17 12:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (79 votes), past polls