Re: sudoku in an sql statement - Mailing list pgsql-general

From Tom Lane
Subject Re: sudoku in an sql statement
Date
Msg-id 6273.1257088787@sss.pgh.pa.us
Whole thread Raw
In response to Re: sudoku in an sql statement  (Thomas Kellerer <spam_eater@gmx.net>)
Responses Re: sudoku in an sql statement
Re: sudoku in an sql statement
List pgsql-general
Thomas Kellerer <spam_eater@gmx.net> writes:
> Merlin Moncure wrote on 31.10.2009 14:32:
>> an oracle guy wrote an sql statement that solves a sudoku
>> puzzle...using an oracle specific feature.  Still, it's pretty neat,
>> and an absolute gem of lateral thinking.
>>
>> http://technology.amis.nl/blog/6404/oracle-rdbms-11gr2-solving-a-sudoku-using-recursive-subquery-factoring

> There is also a DB2 version:
> http://forums.devshed.com/db2-development-114/absolute-sudoku-solver-641065.html

The DB2 version looks amazingly brute-force :-(

I think the Oracle guy's version could easily be adapted to PG 8.4 ---
those little rownum subqueries seem to be just a substitute for not
having generate_series(1,9), and everything else is just string-pushing.
Don't have time to try it myself right now, though.

            regards, tom lane

pgsql-general by date:

Previous
From: Thomas Kellerer
Date:
Subject: Re: Store images on database ou in external files?
Next
From: Hervé Piedvache
Date:
Subject: Translate function and strange results ...