This Single SQL Query Solved My Sudoku In Seconds

Few days ago when I was searching about a solution of some issue I stumble upon a discussion thread. Someone asked about whether SQL queries can solve any real life problem. Of course, we know technologies of Oracle automate real life processes and make them easy. But this thread rang in my mind and caused me to search on if there any particular real life issue that can be solved with help of Oracle query.

And I found it. A guy has developed a query to solve Sudoku problems. When I looked at the query I was surprised and tested for 3 to 4 Sudoku ranging from easy to difficult ones.

How To Solve Sudoku Using Single SQL Query

Here is our Sudoku problem

sudoku problem

To solve the puzzle you need to put all digits in a single string. For space you need to give space in string.

Here our string will be:

Pass this string in below MAGICAL query

The output of above is a solved Sudoku in single string

Arrange it in a 9 x 9 square and you will get


Amazing isn’t it?

Do you want to know this cool guy?  Do you want to thank him for showing you this amazing thing?

Here is the link to his website

Hope you like the article and find it useful. We highly appreciate comments and feedback.

You can also Subscribe here to stay updated on latest posts of

Hi I am Paras.

Thanks for stopping by at Speaking about my brief introduction, I work for a multinational organisation in Oracle related technologies. Being an avid blogger, I would like to inform you about my productivity and motivational blog Speaking of, I will try my best to share knowledge on technologies in as simple and understandable manner as possible. You can also contribute your knowledge on OracleMine by writing to us at Again I appreciate your visit. Hope to see you again and again!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.