Casual Chat: How to Write SQL in TiDB to Achieve 24 Points

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: 闲聊贴:tidb中如何写sql实现24点

| username: ShawnYan

The 24-point rule is still very simple. Given 4 numbers, each number must be used once and only once. Using addition, subtraction, multiplication, division, and parentheses, can you get 24?

| username: hey-hoho | Original post link

Can’t write it +1
But why make things difficult for the database :rofl:
That one by Dege is also an algorithm written in Python, not entirely relying on the database. Wouldn’t it be better to encapsulate it in a backend package for calling?

| username: 小龙虾爱大龙虾 | Original post link

Why does everyone keep asking this question? Someone in the group has already implemented it (though it seems not using TiDB syntax) :joy_cat: