Thursday, November 20, 2008

Save this SQL query

The following query took 28 years to return.


SELECT firstname
FROM all_humanity
WHERE
gender = 'female'
ORDER BY beauty, wisdom



Query returned 53,228,183,834 rows
Rebecca
Mary
Eve
...


But the wait was worth it because I married the first row returned.

3 comments:

  1. NEEEEERRRRRRDDDDD!!! But I guess I am a nerd too because I could read your code. Randy says 0000001 (nerd)

    ReplyDelete
  2. Your order by clause is wrong, it should be:

    ORDER BY beauty DESC, wisdom DESC

    Yikes, better change that quick before Rebecca learns SQL. Sorry I guess I'm a blog stalker now, somehow I found your blog. By the way, I think you are a great person, because you can do hard things and not complain. Have a Merry Christmas!

    ReplyDelete