李家的张麻子:ETL工程师的数据库编程之旅,用ChatGPT打破常规!

news2024/11/19 23:23:45

数据库编程大赛:一条SQL计算扑克牌24点

12月27日,NineData和云数据库技术社区主办,华为云、火山引擎、开源中国、云和恩墨、TDengine、云猿生数据、DORIS、ITPUB等协办单位和媒体,共同举办了本次《数据库编程大赛》。大赛题目「用一条SQL给出扑克牌24点的计算表达式」。

以下冠军选手李家的张麻子的参赛情况的介绍:

图片

参赛选手:李家的张麻子

个人简介:ETL工程师

参赛数据库:SQL Server

性能评测:百万级数据代码性能评测 5.52秒

综合得分:72.6

以下是李家的张麻子选手的代码说明思路:

选手采用的是“人工”穷举算法。值得一提的是,该选手是少数成功使用ChatGPT生成SQL的。首先通过详细列举和排序的方式,全面呈现了所有可能性,并在此基础上由ChatGPT生成SQL代码,再进行适当调整。尽管这种方法稍显粗暴,但是打破常规,正确的运用AI,也是一种新颖的方式。

以下是李家的张麻子选手的算法说明,结尾附完整SQL:


算法说明:

24点SQL编程大赛算法说明(暴力枚举)(SQL SERVER)

1.24点的有效数字组合是有限的,那么我们使用工具(chatgpt等),枚举所有的组合(减去一些重复组合)和一个解法,组成一个结果集。比如(1,1,8,1),(8,1,1,1),(1,8,1,1)(1,1,1,8),只需提取(1,1,1,8)这个组成一个字符数字’1118’,并附带一个解法,最后出的结果就是如下:

With t as (
Select '1118','8×(1+1+1)'
Union all
Select '1126','2×6×(1+1)'
Union all
...
)

2.测试数据集中的数据,我们同样可以用以上的方法,使用工具或者人工将每一行数据使用case when 方法全部罗列排序拼接,因为只有4个数字,那么就是24种情况,如下:

With tt as (
Select 
CASE WHEN c1>=c2 AND c2>=c3 AND c3>=c4 THEN CONCAT(c4,c3,c2,c1) 
CASE WHEN ...
END gs
)

3.根据步骤二排序拼接得到的gs字段就是从小到大的排列后的数字,跟步骤以的结果集去匹配即可。

参赛完整SQL:

WITH t AS (SELECT k.s,k.ss FROM (SELECT '1118' s,'8×(1+1+1)' ss UNION ALL SELECT '1126','2×6×(1+1)' UNION ALL SELECT'1127','(1+2)×(7+1)' UNION ALL SELECT'1128','(1+2)×8×1'UNION ALL SELECT'1129','(1+2)×(9-1)'UNION ALL SELECT'11210','2×(1+10+1)'UNION ALL SELECT'1134','3×4×(1+1)'UNION ALL SELECT'1135','(1+3)×(5+1)'UNION ALL SELECT'1136','(1+3)×6×1'UNION ALL SELECT'1137','(1+3)×(7-1)'UNION ALL SELECT'1138','1+3×8-1'UNION ALL SELECT'1139','1×3×(9-1)'UNION ALL SELECT'11310','3×(10-1-1)'UNION ALL SELECT'1144','4×(1+4+1)'UNION ALL SELECT'1145','(1+4)×5-1'UNION ALL SELECT'1146','1+4×6-1'UNION ALL SELECT'1147','1×4×(7-1)'UNION ALL SELECT'1148','(4-1)×8×1'UNION ALL SELECT'1149','(4-1)×(9-1)'UNION ALL SELECT'11410','4+10×(1+1)'UNION ALL SELECT'1155','(1+5)×(5-1)'UNION ALL SELECT'1156','(5-1)×6×1'UNION ALL SELECT'1157','(5-1)×(7-1)'UNION ALL SELECT'1158','8×(5-1-1)'UNION ALL SELECT'1166','(6+6)×(1+1)'UNION ALL SELECT'1168','6×8÷(1+1)'UNION ALL SELECT'1169','6+9×(1+1)'UNION ALL SELECT'11710','10+7×(1+1)'UNION ALL SELECT'1188','8+8×(1+1)'UNION ALL SELECT'1224','2×4×(2+1)'UNION ALL SELECT'1225','(2+2)×(5+1)'UNION ALL SELECT'1226','(2+2)×6×1'UNION ALL SELECT'1227','(2+2)×(7-1)'UNION ALL SELECT'1228','8×(2+2-1)'UNION ALL SELECT'1229','2×(2+9+1)'UNION ALL SELECT'12210','2+2×(10+1)'UNION ALL SELECT'1233','2×3×(3+1)'UNION ALL SELECT'1234','2×3×4×1'UNION ALL SELECT'1235','(2+3)×5-1'UNION ALL SELECT'1236','3×(2+6)×1'UNION ALL SELECT'1237','2+3×7+1'UNION ALL SELECT'1238','2×(3+8+1)'UNION ALL SELECT'1239','2×(3+9)×1'UNION ALL SELECT'12310','2×(3+10-1)'UNION ALL SELECT'1244','(2+4)×4×1'UNION ALL SELECT'1245','(2+4)×(5-1)'UNION ALL SELECT'1246','4×6×(2-1)'UNION ALL SELECT'1247','2×(4+7+1)'UNION ALL SELECT'1248','2×(4+8)×1'UNION ALL SELECT'1249','2×(4+9-1)'UNION ALL SELECT'12410','4+2×10×1'UNION ALL SELECT'1255','5×5-2+1'UNION ALL SELECT'1256','2×(5+6+1)'UNION ALL SELECT'1257','2×(5+7)×1'UNION ALL SELECT'1258','2×(5+8-1)'UNION ALL SELECT'1259','5+2×9+1'UNION ALL SELECT'12510','5+2×10-1'UNION ALL SELECT'1266','2×(6+6)×1'UNION ALL SELECT'1267','2×(6+7-1)'UNION ALL SELECT'1268','6+2×(8+1)'UNION ALL SELECT'1269','6+2×9×1'UNION ALL SELECT'12610','6+2×(10-1)'UNION ALL SELECT'1277','(7×7-1)÷2'UNION ALL SELECT'1278','7+2×8+1'UNION ALL SELECT'1279','2×7+9+1'UNION ALL SELECT'12710','2×7+10×1'UNION ALL SELECT'1288','2×8+8×1'UNION ALL SELECT'1289','2×8+9-1'UNION ALL SELECT'12810','10+2×(8-1)'UNION ALL SELECT'1333','(3+3)×(3+1)'UNION ALL SELECT'1334','(3+3)×4×1'UNION ALL SELECT'1335','(3+3)×(5-1)'UNION ALL SELECT'1336','3+3×(6+1)'UNION ALL SELECT'1337','3+3×7×1'UNION ALL SELECT'1338','3+3×(8-1)'UNION ALL SELECT'1339','(3+9)×(3-1)'UNION ALL SELECT'13310','3×(10-3+1)'UNION ALL SELECT'1344','3×(4+4)×1'UNION ALL SELECT'1345','3+4×5+1'UNION ALL SELECT'1346','6÷(1-3÷4)'UNION ALL SELECT'1347','4+3×7-1'UNION ALL SELECT'1348','(4+8)×(3-1)'UNION ALL SELECT'1349','4×(9-3)×1'UNION ALL SELECT'13410','4+10×(3-1)'UNION ALL SELECT'1356','5+3×6+1'UNION ALL SELECT'1357','(5+7)×(3-1)'UNION ALL SELECT'1358','3×5+8+1'UNION ALL SELECT'1359','3×5+9×1'UNION ALL SELECT'13510','3×5+10-1'UNION ALL SELECT'1366','3×6+6×1'UNION ALL SELECT'1367','3×6+7-1'UNION ALL SELECT'1368','(6-3)×8×1'UNION ALL SELECT'1369','(6-3)×(9-1)'UNION ALL SELECT'13610','3×10-6×1'UNION ALL SELECT'1377','(7-3)×(7-1)'UNION ALL SELECT'1378','8×(7-3-1)'UNION ALL SELECT'1379','9÷3×(7+1)'UNION ALL SELECT'13710','10+7×(3-1)'UNION ALL SELECT'1388','8÷3×(8+1)'UNION ALL SELECT'1389','8÷3×9×1'UNION ALL SELECT'13810','8÷3×(10-1)'UNION ALL SELECT'1399','9÷3×(9-1)'UNION ALL SELECT'13910','3×(10+1)-9'UNION ALL SELECT'131010','3+10+10+1'UNION ALL SELECT'1444','4+4×(4+1)'UNION ALL SELECT'1445','4+4×5×1'UNION ALL SELECT'1446','4+4×(6-1)'UNION ALL SELECT'1447','4×4+7+1'UNION ALL SELECT'1448','4×4+8×1'UNION ALL SELECT'1449','4×4+9-1'UNION ALL SELECT'14410','4×(10-4)×1'UNION ALL SELECT'1455','4+5×(5-1)'UNION ALL SELECT'1456','6÷(5÷4-1)'UNION ALL SELECT'1457','4×7-5+1'UNION ALL SELECT'1458','8+4×(5-1)'UNION ALL SELECT'1459','5×(9-4)-1'UNION ALL SELECT'14510','4×(10-5+1)'UNION ALL SELECT'1466','6+6×(4-1)'UNION ALL SELECT'1467','6×(7-4+1)'UNION ALL SELECT'1468','6×(8-4)×1'UNION ALL SELECT'1469','6×(9-4-1)'UNION ALL SELECT'14610','10×(4-1)-6'UNION ALL SELECT'1477','(7-4)×(7+1)'UNION ALL SELECT'1478','(7-4)×8×1'UNION ALL SELECT'1479','(7-4)×(9-1)'UNION ALL SELECT'1488','4×8-8×1'UNION ALL SELECT'1489','4×8-9+1'UNION ALL SELECT'14910','4+9+10+1'UNION ALL SELECT'141010','4+10+10×1'UNION ALL SELECT'1555','5×(5-1÷5)'UNION ALL SELECT'1556','5×6-5-1'UNION ALL SELECT'1559','(9-5)×(5+1)'UNION ALL SELECT'15510','5×(10-5)-1'UNION ALL SELECT'1566','5×6-6×1'UNION ALL SELECT'1567','5×6-7+1'UNION ALL SELECT'1568','6×(8-5+1)'UNION ALL SELECT'1569','6×(9-5)×1'UNION ALL SELECT'15610','6×(10-5-1)'UNION ALL SELECT'1578','8×(7-5+1)'UNION ALL SELECT'1579','(9-5)×(7-1)'UNION ALL SELECT'15710','5×7-10-1'UNION ALL SELECT'1588','(8-5)×8×1'UNION ALL SELECT'1589','(8-5)×(9-1)'UNION ALL SELECT'15810','5+8+10+1'UNION ALL SELECT'1599','5+9+9+1'UNION ALL SELECT'15910','5+9+10×1'UNION ALL SELECT'151010','5+10+10-1'UNION ALL SELECT'1666','6×(6-1)-6'UNION ALL SELECT'1668','6÷(1-6÷8)'UNION ALL SELECT'1669','6×(9-6+1)'UNION ALL SELECT'16610','6×(10-6)×1'UNION ALL SELECT'1679','(9-6)×(7+1)'UNION ALL SELECT'16710','6+7+10+1'UNION ALL SELECT'1688','8×(8-6+1)'UNION ALL SELECT'1689','6+8+9+1'UNION ALL SELECT'16810','6+8+10×1'UNION ALL SELECT'1699','6+9+9×1'UNION ALL SELECT'16910','6+9+10-1'UNION ALL SELECT'1779','7+7+9+1'UNION ALL SELECT'17710','7+7+10×1'UNION ALL SELECT'1788','7+8+8+1'UNION ALL SELECT'1789','7+8+9×1'UNION ALL SELECT'17810','7+8+10-1'UNION ALL SELECT'1799','7+9+9-1'UNION ALL SELECT'17910','(10-7)×(9-1)'UNION ALL SELECT'1888','8+8+8×1'UNION ALL SELECT'1889','8+8+9-1'UNION ALL SELECT'18810','8×(10-8+1)'UNION ALL SELECT'2223','(2+2)×3×2'UNION ALL SELECT'2224','(2+2)×(4+2)'UNION ALL SELECT'2225','(2+2×5)×2'UNION ALL SELECT'2227','2×(2×7-2)'UNION ALL SELECT'2228','(2+2+8)×2'UNION ALL SELECT'2229','2+(2+9)×2'UNION ALL SELECT'22210','2+2+10×2'UNION ALL SELECT'2233','2×(3+3)×2'UNION ALL SELECT'2234','3×(2+4+2)'UNION ALL SELECT'2235','3×(2×5-2)'UNION ALL SELECT'2236','(2×3+6)×2'UNION ALL SELECT'2237','(2+3+7)×2'UNION ALL SELECT'2238','2+(3+8)×2'UNION ALL SELECT'2239','2×3+9×2'UNION ALL SELECT'22310','2×(3+10)-2'UNION ALL SELECT'2244','(2×4+4)×2'UNION ALL SELECT'2245','2+4×5+2'UNION ALL SELECT'2246','(2+4+6)×2'UNION ALL SELECT'2247','2+(4+7)×2'UNION ALL SELECT'2248','(2+4)×8÷2'UNION ALL SELECT'2249','2+4+9×2'UNION ALL SELECT'22410','2×(4+10-2)'UNION ALL SELECT'2255','(2+5+5)×2'UNION ALL SELECT'2256','2+(5+6)×2'UNION ALL SELECT'2257','2×5+7×2'UNION ALL SELECT'2258','2×(5+8)-2'UNION ALL SELECT'2259','2×(5+9-2)'UNION ALL SELECT'22510','(5-2)×(10-2)'UNION ALL SELECT'2266','(2+6)×6÷2'UNION ALL SELECT'2267','2×(6+7)-2'UNION ALL SELECT'2268','2+6+8×2'UNION ALL SELECT'2269','(6÷2+9)×2'UNION ALL SELECT'22610','2×6+10+2'UNION ALL SELECT'2277','2×(7+7-2)'UNION ALL SELECT'2278','2×7+8+2'UNION ALL SELECT'22710','2×(7+10÷2)'UNION ALL SELECT'2288','2×(8+8÷2)'UNION ALL SELECT'2289','8+2×9-2'UNION ALL SELECT'22810','2×8+10-2'UNION ALL SELECT'22910','10+(9-2)×2'UNION ALL SELECT'221010','2+10+10+2'UNION ALL SELECT'2333','(3+3×3)×2'UNION ALL SELECT'2335','3+3×(5+2)'UNION ALL SELECT'2336','(3+3+6)×2'UNION ALL SELECT'2337','3×(3+7-2)'UNION ALL SELECT'2338','(3+3)×8÷2'UNION ALL SELECT'2339','3+3+9×2'UNION ALL SELECT'23310','3×(3+10÷2)'UNION ALL SELECT'2344','3×4×(4-2)'UNION ALL SELECT'2345','(3+4+5)×2'UNION ALL SELECT'2346','3×(4+6-2)'UNION ALL SELECT'2347','4+(3+7)×2'UNION ALL SELECT'2348','3×(4+8÷2)'UNION ALL SELECT'2349','4×(3+9)÷2'UNION ALL SELECT'23410','3×4+10+2'UNION ALL SELECT'2355','(3+5)×(5-2)'UNION ALL SELECT'2356','(3+5)×6÷2'UNION ALL SELECT'2357','3×5+7+2'UNION ALL SELECT'2358','3+5+8×2'UNION ALL SELECT'2359','(3+5×9)÷2'UNION ALL SELECT'23510','(5-3+10)×2'UNION ALL SELECT'2366','(3×6-6)×2'UNION ALL SELECT'2367','3+6×7÷2'UNION ALL SELECT'2368','3×6+8-2'UNION ALL SELECT'2369','(6-3+9)×2'UNION ALL SELECT'23610','3×(6+10)÷2'UNION ALL SELECT'2377','3+7+7×2'UNION ALL SELECT'2378','(7-3+8)×2'UNION ALL SELECT'2379','3×(7+9)÷2'UNION ALL SELECT'23710','7-3+10×2'UNION ALL SELECT'2388','3×(8+8)÷2'UNION ALL SELECT'2389','8×(9-3×2)'UNION ALL SELECT'23810','8+10+3×2'UNION ALL SELECT'2399','9-3+9×2'UNION ALL SELECT'23910','3+9+10+2'UNION ALL SELECT'231010','10-(3-10)×2'UNION ALL SELECT'2444','(4+4+4)×2'UNION ALL SELECT'2445','(4+4)×(5-2)'UNION ALL SELECT'2446','4+(4+6)×2'UNION ALL SELECT'2447','4+4×(7-2)'UNION ALL SELECT'2448','4+4+8×2'UNION ALL SELECT'2449','4×(9-2)-4'UNION ALL SELECT'24410','4+4×10÷2'UNION ALL SELECT'2455','4+(5+5)×2'UNION ALL SELECT'2456','4+5×(6-2)'UNION ALL SELECT'2457','4×(5+7)÷2'UNION ALL SELECT'2458','4+5×8÷2'UNION ALL SELECT'2459','(9-5)×(4+2)'UNION ALL SELECT'24510','4+10+5×2'UNION ALL SELECT'2466','4×(6+6)÷2'UNION ALL SELECT'2467','4+6+7×2'UNION ALL SELECT'2468','6÷4×8×2'UNION ALL SELECT'2469','6+4×9÷2'UNION ALL SELECT'24610','(6-4+10)×2'UNION ALL SELECT'2477','(7+7)×2-4'UNION ALL SELECT'2478','4×7-8÷2'UNION ALL SELECT'2479','(7-4+9)×2'UNION ALL SELECT'24710','(7-4)×(10-2)'UNION ALL SELECT'2488','8+4×8÷2'UNION ALL SELECT'2489','8×(9-4-2)'UNION ALL SELECT'24810','4+8+10+2'UNION ALL SELECT'2499','4+9+9+2'UNION ALL SELECT'24910','4×9-10-2'UNION ALL SELECT'241010','10×(4÷10+2)'UNION ALL SELECT'2557','5+5+7×2'UNION ALL SELECT'2558','8×(5÷5+2)'UNION ALL SELECT'2559','5+9+5×2'UNION ALL SELECT'25510','(5-2÷10)×5'UNION ALL SELECT'2566','6+6×(5-2)'UNION ALL SELECT'2567','6×(7-5+2)'UNION ALL SELECT'2568','5×6-8+2'UNION ALL SELECT'2569','9+6×5÷2'UNION ALL SELECT'25610','6÷5×10×2'UNION ALL SELECT'2577','7+7+5×2'UNION ALL SELECT'2578','8×(5×2-7)'UNION ALL SELECT'2579','5×7-9-2'UNION ALL SELECT'25710','5+7+10+2'UNION ALL SELECT'2588','(5×8+8)÷2'UNION ALL SELECT'2589','5+8+9+2'UNION ALL SELECT'25810','(8-5)×(10-2)'UNION ALL SELECT'25910','9-5+10×2'UNION ALL SELECT'251010','(10÷5+10)×2'UNION ALL SELECT'2666','6+6+6×2'UNION ALL SELECT'2667','(6+6×7)÷2'UNION ALL SELECT'2668','6×(8-6+2)'UNION ALL SELECT'2669','(6×9-6)÷2'UNION ALL SELECT'26610','6+6+10+2'UNION ALL SELECT'2678','8×(7-6+2)'UNION ALL SELECT'2679','6+7+9+2'UNION ALL SELECT'26710','(10-7)×(6+2)'UNION ALL SELECT'2688','6+8+8+2'UNION ALL SELECT'2689','8÷6×9×2'UNION ALL SELECT'26810','(8-6+10)×2'UNION ALL SELECT'2699','(9-6+9)×2'UNION ALL SELECT'26910','6×(9-10÷2)'UNION ALL SELECT'261010','6+10+10-2'UNION ALL SELECT'2778','7+7+8+2'UNION ALL SELECT'27710','7×(10÷7+2)'UNION ALL SELECT'2788','(7×8-8)÷2'UNION ALL SELECT'2789','(7+9)×2-8'UNION ALL SELECT'27910','7+9+10-2'UNION ALL SELECT'271010','(10-7)×(10-2)'UNION ALL SELECT'2888','8×(8÷8+2)'UNION ALL SELECT'2889','8×(9-8+2)'UNION ALL SELECT'28810','8+8+10-2'UNION ALL SELECT'2899','8+9+9-2'UNION ALL SELECT'28910','8×(10-9+2)'UNION ALL SELECT'281010','8×(10÷10+2)'UNION ALL SELECT'291010','9+10+10÷2'UNION ALL SELECT'3333','3×3×3-3'UNION ALL SELECT'3334','3+(3+4)×3'UNION ALL SELECT'3335','3×3+5×3'UNION ALL SELECT'3336','3+3+6×3'UNION ALL SELECT'3337','(3+3)×(7-3)'UNION ALL SELECT'3338','3+3×8-3'UNION ALL SELECT'3339','3×(9-3÷3)'UNION ALL SELECT'33310','3+3×(10-3)'UNION ALL SELECT'3344','3×4+4×3'UNION ALL SELECT'3345','3×(4+5)-3'UNION ALL SELECT'3346','3+4×6-3'UNION ALL SELECT'3347','3×(4+7-3)'UNION ALL SELECT'3348','(4-3)×8×3'UNION ALL SELECT'3349','(3-4+9)×3'UNION ALL SELECT'3355','5×5-3÷3'UNION ALL SELECT'3356','(3+5)×(6-3)'UNION ALL SELECT'3357','(3×5-7)×3'UNION ALL SELECT'3359','(3+5)×9÷3'UNION ALL SELECT'33510','(3-5+10)×3'UNION ALL SELECT'3366','3×(6+6÷3)'UNION ALL SELECT'3367','6+3×7-3'UNION ALL SELECT'3368','(3+6)×8÷3'UNION ALL SELECT'3369','3-6+9×3'UNION ALL SELECT'33610','(3×6-10)×3'UNION ALL SELECT'3377','7×(3÷7+3)'UNION ALL SELECT'3378','7+8+3×3'UNION ALL SELECT'3379','3+7×9÷3'UNION ALL SELECT'3388','8÷(3-8÷3)'UNION ALL SELECT'3389','8×(9-3-3)'UNION ALL SELECT'33810','3+8+10+3'UNION ALL SELECT'3399','3+9+9+3'UNION ALL SELECT'33910','3-9+10×3'UNION ALL SELECT'3444','4×(4+3)-4'UNION ALL SELECT'3445','4×4+5+3'UNION ALL SELECT'3446','(4+4)×(6-3)'UNION ALL SELECT'3447','(4÷4+7)×3'UNION ALL SELECT'3448','4+4×(8-3)'UNION ALL SELECT'3449','(4+4)×9÷3'UNION ALL SELECT'34410','4×(10-3)-4'UNION ALL SELECT'3455','4+5+5×3'UNION ALL SELECT'3456','6×(5-4+3)'UNION ALL SELECT'3457','4+5×(7-3)'UNION ALL SELECT'3458','(4+5)×8÷3'UNION ALL SELECT'3459','(4-5+9)×3'UNION ALL SELECT'34510','4÷5×10×3'UNION ALL SELECT'3466','(6-4+6)×3'UNION ALL SELECT'3468','6×(4+8)÷3'UNION ALL SELECT'3469','(6-4)×(9+3)'UNION ALL SELECT'34610','4+6×10÷3'UNION ALL SELECT'3477','4×7-7+3'UNION ALL SELECT'3478','8+4×(7-3)'UNION ALL SELECT'3479','4-7+9×3'UNION ALL SELECT'34710','4+7+10+3'UNION ALL SELECT'3489','4+8+9+3'UNION ALL SELECT'34810','4×(8+10)÷3'UNION ALL SELECT'3499','4×(9+9)÷3'UNION ALL SELECT'341010','4-10+10×3'UNION ALL SELECT'3556','6×(5÷5+3)'UNION ALL SELECT'3557','(5÷5+7)×3'UNION ALL SELECT'3558','5-5+8×3'UNION ALL SELECT'3559','5×(9÷5+3)'UNION ALL SELECT'3566','(6+6)×(5-3)'UNION ALL SELECT'3567','(6-5+7)×3'UNION ALL SELECT'3568','(6-5)×8×3'UNION ALL SELECT'3569','(5-6+9)×3'UNION ALL SELECT'35610','5+6+10+3'UNION ALL SELECT'3578','5×7-8-3'UNION ALL SELECT'3579','5+7+9+3'UNION ALL SELECT'35710','(5-7+10)×3'UNION ALL SELECT'3588','5+8+8+3'UNION ALL SELECT'3589','5-8+9×3'UNION ALL SELECT'3599','9+5×9÷3'UNION ALL SELECT'35910','9-(5-10)×3'UNION ALL SELECT'351010','(10-10÷5)×3'UNION ALL SELECT'3666','6+6×(6-3)'UNION ALL SELECT'3667','(6÷6+7)×3'UNION ALL SELECT'3668','6-6+8×3'UNION ALL SELECT'3669','6+6+9+3'UNION ALL SELECT'36610','10×(6-3)-6'UNION ALL SELECT'3677','6×(7÷7+3)'UNION ALL SELECT'3678','6+7+8+3'UNION ALL SELECT'3679','(6-7+9)×3'UNION ALL SELECT'36710','10+7×6÷3'UNION ALL SELECT'3688','6×8-8×3'UNION ALL SELECT'3689','(8-6)×(9+3)'UNION ALL SELECT'36810','(6-8+10)×3'UNION ALL SELECT'3699','6-9+9×3'UNION ALL SELECT'36910','6×9-10×3'UNION ALL SELECT'361010','6×(10÷10+3)'UNION ALL SELECT'3777','7+7+7+3'UNION ALL SELECT'3778','7-7+8×3'UNION ALL SELECT'3779','(9-7÷7)×3'UNION ALL SELECT'37710','7×(10-7)+3'UNION ALL SELECT'3788','(7+8÷8)×3'UNION ALL SELECT'3789','(7-8+9)×3'UNION ALL SELECT'3799','(7+9÷9)×3'UNION ALL SELECT'37910','(7-9+10)×3'UNION ALL SELECT'371010','7+10+10-3'UNION ALL SELECT'3888','(8+8-8)×3'UNION ALL SELECT'3889','8×(9-8)×3'UNION ALL SELECT'38810','(8×10-8)÷3'UNION ALL SELECT'3899','(8+9-9)×3'UNION ALL SELECT'38910','8+9+10-3'UNION ALL SELECT'381010','(8+10-10)×3'UNION ALL SELECT'3999','9+9+9-3'UNION ALL SELECT'39910','(9+9-10)×3'UNION ALL SELECT'391010','(9-10÷10)×3'UNION ALL SELECT'4444','4+4+4×4'UNION ALL SELECT'4445','(4÷4+5)×4'UNION ALL SELECT'4446','4+4×6-4'UNION ALL SELECT'4447','(4+4)×(7-4)'UNION ALL SELECT'4448','4×(4+8÷4)'UNION ALL SELECT'4449','4+4×(9-4)'UNION ALL SELECT'44410','(4×4-10)×4'UNION ALL SELECT'4455','4×(5+5-4)'UNION ALL SELECT'4456','(5-4)×6×4'UNION ALL SELECT'4457','(4-5+7)×4'UNION ALL SELECT'4458','4+5×(8-4)'UNION ALL SELECT'44510','4-(5-10)×4'UNION ALL SELECT'4468','(4-6+8)×4'UNION ALL SELECT'4469','4÷6×9×4'UNION ALL SELECT'44610','4+6+10+4'UNION ALL SELECT'4477','7×(4-4÷7)'UNION ALL SELECT'4478','4×7-8+4'UNION ALL SELECT'4479','4+7+9+4'UNION ALL SELECT'44710','(10-7)×(4+4)'UNION ALL SELECT'4488','4+8+8+4'UNION ALL SELECT'4489','4×9-8-4'UNION ALL SELECT'44810','4+8×10÷4'UNION ALL SELECT'441010','(10×10-4)÷4'UNION ALL SELECT'4555','(5+5÷5)×4'UNION ALL SELECT'4556','5-5+6×4'UNION ALL SELECT'4557','(7-5÷5)×4'UNION ALL SELECT'4558','8×(4-5÷5)'UNION ALL SELECT'4559','5×(9-5)+4'UNION ALL SELECT'45510','5+5+10+4'UNION ALL SELECT'4566','(5+6÷6)×4'UNION ALL SELECT'4567','(5-6+7)×4'UNION ALL SELECT'4568','8×(5-6+4)'UNION ALL SELECT'4569','5+6+9+4'UNION ALL SELECT'45610','5×6-10+4'UNION ALL SELECT'4577','(5+7÷7)×4'UNION ALL SELECT'4578','5+7+8+4'UNION ALL SELECT'4579','7×(9-5)-4'UNION ALL SELECT'45710','(7-5)×10+4'UNION ALL SELECT'4588','(5+8÷8)×4'UNION ALL SELECT'4589','(5-8+9)×4'UNION ALL SELECT'45810','5×(8÷10+4)'UNION ALL SELECT'4599','(5+9÷9)×4'UNION ALL SELECT'45910','(5-9+10)×4'UNION ALL SELECT'451010','(5+10÷10)×4'UNION ALL SELECT'4666','(6+6-6)×4'UNION ALL SELECT'4667','6+6×(7-4)'UNION ALL SELECT'4668','6+6+8+4'UNION ALL SELECT'4669','6+9×(6-4)'UNION ALL SELECT'46610','6×(6+10)÷4'UNION ALL SELECT'4677','6+7+7+4'UNION ALL SELECT'4678','(8-7)×6×4'UNION ALL SELECT'4679','6×(7+9)÷4'UNION ALL SELECT'46710','7×(10-6)-4'UNION ALL SELECT'4688','(6+8-8)×4'UNION ALL SELECT'4689','6+8×9÷4'UNION ALL SELECT'46810','8-(6-10)×4'UNION ALL SELECT'4699','(6+9-9)×4'UNION ALL SELECT'46910','(6+9×10)÷4'UNION ALL SELECT'461010','(6+10-10)×4'UNION ALL SELECT'4777','(7-7÷7)×4'UNION ALL SELECT'4778','(7+7-8)×4'UNION ALL SELECT'4788','(7-8÷8)×4'UNION ALL SELECT'4789','(7+8-9)×4'UNION ALL SELECT'47810','10+8×7÷4'UNION ALL SELECT'4799','(7-9÷9)×4'UNION ALL SELECT'47910','(7+9-10)×4'UNION ALL SELECT'471010','(7-10÷10)×4'UNION ALL SELECT'4888','8+8×8÷4'UNION ALL SELECT'4889','8×(8-9+4)'UNION ALL SELECT'48810','(8+8-10)×4'UNION ALL SELECT'4899','(4-9÷9)×8'UNION ALL SELECT'48910','8×(9-10+4)'UNION ALL SELECT'481010','8+10+10-4'UNION ALL SELECT'49910','9+9+10-4'UNION ALL SELECT'5555','5×5-5÷5'UNION ALL SELECT'5556','5×5-6+5'UNION ALL SELECT'5559','5+5+9+5'UNION ALL SELECT'5566','5×(6-6÷5)'UNION ALL SELECT'5567','6-7+5×5'UNION ALL SELECT'5568','5+6+8+5'UNION ALL SELECT'5577','5+7+7+5'UNION ALL SELECT'5578','7-8+5×5'UNION ALL SELECT'55710','(5+7)×10÷5'UNION ALL SELECT'5588','5×5-8÷8'UNION ALL SELECT'5589','8-9+5×5'UNION ALL SELECT'55810','8×(5+10)÷5'UNION ALL SELECT'5599','5×5-9÷9'UNION ALL SELECT'55910','9-10+5×5'UNION ALL SELECT'551010','5×5-10÷10'UNION ALL SELECT'5666','6×(5-6÷6)'UNION ALL SELECT'5667','6+6+7+5'UNION ALL SELECT'5668','6+6×(8-5)'UNION ALL SELECT'5669','6×9-6×5'UNION ALL SELECT'56610','(6+6)×10÷5'UNION ALL SELECT'5677','(5-7÷7)×6'UNION ALL SELECT'5678','6×(7-8+5)'UNION ALL SELECT'5679','6+9×(7-5)'UNION ALL SELECT'5688','8×(6-8+5)'UNION ALL SELECT'5689','6×(8-9+5)'UNION ALL SELECT'56810','6×8÷10×5'UNION ALL SELECT'5699','9-(6-9)×5'UNION ALL SELECT'56910','6+9×10÷5'UNION ALL SELECT'561010','6×(10+10)÷5'UNION ALL SELECT'5779','(9-7)×(7+5)'UNION ALL SELECT'57710','10+7×(7-5)'UNION ALL SELECT'5788','(7+8)×8÷5'UNION ALL SELECT'5789','8×(7-9+5)'UNION ALL SELECT'57810','(10-8)×(7+5)'UNION ALL SELECT'57910','9-(7-10)×5'UNION ALL SELECT'571010','10+7×10÷5'UNION ALL SELECT'5888','8×8-8×5'UNION ALL SELECT'5889','8×9÷(8-5)'UNION ALL SELECT'58810','8+8×10÷5'UNION ALL SELECT'591010','9+10+10-5'UNION ALL SELECT'6666','6+6+6+6'UNION ALL SELECT'6668','(6+6-8)×6'UNION ALL SELECT'6669','6+6×(9-6)'UNION ALL SELECT'66610','6×10-6×6'UNION ALL SELECT'6679','(6+7-9)×6'UNION ALL SELECT'66710','6-(7-10)×6'UNION ALL SELECT'6688','6×8÷(8-6)'UNION ALL SELECT'6689','(8-6)×9+6'UNION ALL SELECT'66810','(6+8-10)×6'UNION ALL SELECT'66910','(9-6)×10-6'UNION ALL SELECT'67710','(7+7-10)×6'UNION ALL SELECT'6789','8÷(9-7)×6'UNION ALL SELECT'67810','8×(7-10+6)'UNION ALL SELECT'6799','(7+9)×9÷6'UNION ALL SELECT'671010','(10-7)×10-6'UNION ALL SELECT'6888','8+8×(8-6)'UNION ALL SELECT'6889','(8+8)×9÷6'UNION ALL SELECT'68810','8×(8+10)÷6'UNION ALL SELECT'6899','8×(9+9)÷6'UNION ALL SELECT'68910','9×(10-8)+6'UNION ALL SELECT'69910','9+9×10÷6'UNION ALL SELECT'6101010','10+10+10-6'UNION ALL SELECT'77910','10+(9-7)×7'UNION ALL SELECT'7889','8+8×(9-7)'UNION ALL SELECT'78810','8×10-8×7'UNION ALL SELECT'78910','8×9÷(10-7)'UNION ALL SELECT'781010','10-(8-10)×7'UNION ALL SELECT'88810','8+8×(10-8)' )k), tt AS( SELECT  id,c1,c2,c3,c4,  CASE WHEN c1>=c2 AND c2>=c3 AND c3>=c4 THEN CONCAT(c4,c3,c2,c1)     WHEN c1>=c2 AND c2>=c4 AND c4>=c3 THEN CONCAT(c3,c4,c2,c1)    WHEN c1>=c3 AND c3>=c2 AND c2>=c4 THEN CONCAT(c4,c2,c3,c1)    WHEN c1>=c3 AND c3>=c4 AND c4>=c2 THEN CONCAT(c2,c4,c3,c1)    WHEN c1>=c4 AND c4>=c3 AND c3>=c2 THEN CONCAT(c2,c3,c4,c1)    WHEN c1>=c4 AND c4>=c2 AND c2>=c3 THEN CONCAT(c3,c2,c4,c1)    WHEN c2>=c1 AND c1>=c3 AND c3>=c4 THEN CONCAT(c4,c3,c1,c2)    WHEN c2>=c1 AND c1>=c4 AND c4>=c3 THEN CONCAT(c3,c4,c1,c2)    WHEN c2>=c3 AND c3>=c4 AND c4>=c1 THEN CONCAT(c1,c4,c3,c2)    WHEN c2>=c3 AND c3>=c1 AND c1>=c4 THEN CONCAT(c4,c1,c3,c2)    WHEN c2>=c4 AND c4>=c1 AND c1>=c3 THEN CONCAT(c3,c1,c4,c2)    WHEN c2>=c4 AND c4>=c3 AND c3>=c1 THEN CONCAT(c1,c3,c4,c2)    WHEN c3>=c1 AND c1>=c2 AND c2>=c4 THEN CONCAT(c4,c2,c1,c3)    WHEN c3>=c1 AND c1>=c4 AND c4>=c2 THEN CONCAT(c2,c4,c1,c3)    WHEN c3>=c2 AND c2>=c1 AND c1>=c4 THEN CONCAT(c4,c1,c2,c3)    WHEN c3>=c2 AND c2>=c4 AND c4>=c1 THEN CONCAT(c1,c4,c2,c3)    WHEN c3>=c4 AND c4>=c1 AND c1>=c2 THEN CONCAT(c2,c1,c4,c3)    WHEN c3>=c4 AND c4>=c2 AND c2>=c1 THEN CONCAT(c1,c2,c4,c3)    WHEN c4>=c3 AND c3>=c2 AND c2>=c1 THEN CONCAT(c1,c2,c3,c4)    WHEN c4>=c3 AND c3>=c1 AND c1>=c2 THEN CONCAT(c2,c1,c3,c4)    WHEN c4>=c2 AND c2>=c3 AND c3>=c1 THEN CONCAT(c1,c3,c2,c4)    WHEN c4>=c2 AND c2>=c1 AND c1>=c3 THEN CONCAT(c3,c1,c2,c4)    WHEN c4>=c1 AND c1>=c2 AND c2>=c3 THEN CONCAT(c3,c2,c1,c4)    WHEN c4>=c1 AND c1>=c3 AND c3>=c2 THEN CONCAT(c2,c3,c1,c4)        END gs     FROM poker24.cards)SELECT tt.id,tt.c1,tt.c2,tt.c3,tt.c4,t.ss FROM tt LEFT JOIN t ON tt.gs = t.s

《数据库编程大赛》

下一次再聚!

感谢大家对本次《数据库编程大赛》的关注和支持,欢迎加入技术交流群,更多精彩活动不断,我们下次再相聚!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1371160.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

基于SpringBoot的精品在线试题库系统(系统+数据库+文档)

🍅点赞收藏关注 → 私信领取本源代码、数据库🍅 本人在Java毕业设计领域有多年的经验,陆续会更新更多优质的Java实战项目 希望你能有所收获,少走一些弯路。🍅关注我不迷路🍅一、绪论 1. 研究背景 现在大家…

PostgreSQL ZIP版安装完全手册

前言 ZIP免安装版下载地址:社区 DL 页面 (enterprisedb.com) 选择所需的版本下载即可。 安装 将下载的zip安装包(我这里下载的是postgresql-15.5-1-windows-x64-binaries.zip)解压至D盘根路径下,解压后路径:D:/pgsq…

vue+springboot+mybatis-plus实现乡村公共文化服务系统

项目前端:https://gitee.com/anxin-personal-project/rural-public-cultural-services-front 项目后端:https://gitee.com/anxin-personal-project/rural-public-cultural-services-behind 1.系统简介 乡村公共服务文化提供给管理员、商家、村民。管理…

k8s-存储 11

一、configmapu存储 首先,确保集群正常,节点都处于就绪状态 Configmap用于保存配置数据,以键值对形式存储。configMap资源提供了向 Pod 注入配置数据的方法,旨在让镜像和配置文件解耦,以便实现镜像的可移植性和可复用…

ASM磁盘管理:从初始化参数到自动化管理的全面解析

文章目录 一、引言二、ASM初始化参数三、ASM三大系统权限四、ASM实例的启停1.Oracle ASM的启停可以通过两种方式进行2.查看集群中的资源状态3.配置 ASM资源随着系统启动而启动4.配置数据库实例随着ASM启动而启动 五、数据库实例与ASM的交互六、 启动策略详解七、 ASM后台进程八…

汇聚数据库创新力量,打造千行万业数据基石

12月28日,以“汇聚数据库创新力量,打造千行万业数据基石”为主题的openGauss Summit 2023在北京举行。会上,openGauss社区理事会理事长胡正策发表《汇聚数据库创新力量,打造千行万业数据基石》主题演讲,他表示&#xf…

面相圆润是有福气的象征

在中国传统文化中,面相是一个非常重要的概念。相信大家肯定听说过“相由心生”这个成语吧,这就是告诉我们,一个人的面貌其实是可以反映出他内心的状态和气质,也可以反映其性格、健康状况和运势等。而一个圆润的面相,则…

代码混淆:保护您的应用程序

目录 引言 什么是代码混淆? 代码混淆常见手段 代码混淆的作用 代码混淆可能带来的问题 常用的混淆工具 如何使用ipaguard进行混淆 总结 引言 在当今数字化时代,移动应用程序已经成为人们生活和工作中不可或缺的一部分。但是,随着应用…

网络之路28:二层链路聚合

正文共:1666 字 14 图,预估阅读时间:2 分钟 目录 网络之路第一章:Windows系统中的网络 0、序言 1、Windows系统中的网络1.1、桌面中的网卡1.2、命令行中的网卡1.3、路由表1.4、家用路由器 网络之路第二章:认识企业设备…

Multimodal Segmentation of Medical Images with Heavily Missing Data

F是mapping function 吐槽 图3太简单了吧。作者未提供代码

C++实现简单贪吃蛇游戏

文章目录 1 开发历程2 开发思路3 使用介绍4 源文件代码5 游戏截图6 小结 1 开发历程 游戏使用C语言开发,是博主某个下午心血来潮的结果,后面又花了点时间加了计分,记录历史得分的功能。 2 开发思路 其实贪吃蛇主要难在蛇身的移动上&#x…

0-1背包问题-例题

题目摘自《卡码网》46题 题意理解 m种材料——对应m物品 大小问n的行李箱——对应大小为n的背包 所以该问题是一个0-1背包问题,采用动态规划的一般思路来解题。 解题思路: 动规五部曲: (1)定义二维dp数组,明…

把图表题注编号由“一.1”改为“1.1“ (方法一)

前置设置: 手打章节标题,“绪论”,“ 相关理论和技术方法”。给章节标题设置样式 “标题一”,设置为一级标题。打开导航窗格,可以不开,我纯粹是为了操作方便。 1、选中第一章的标题--“绪论”,…

WhatsApp营销是什么?

WhatsApp营销是什么? WhatsApp营销是一种信息和服务营销,是外贸企业的营销利器。WhatsApp可用于售前咨询、售后服务以及品牌宣传等多种场景,跨境企业可通过WhatsApp快速链接目标客户,提供7x24h全天候客户支持,以建立良好的客户关…

UltraScale 和 UltraScale+ 生成已加密文件和已经过身份验证的文件

注释 :如需了解更多信息,请参阅《使用加密和身份验证确保 UltraScale/UltraScale FPGA 比特流的安全》 (XAPP1267)。 要生成加密比特流,请在 Vivado IDE 中打开已实现的设计。在主工具栏中,依次选择“Flow” → “Bitstream Setti…

源码|redis7.2.2|sds

文章目录 前言Type && EncodingsdsencodingcreateStringObjectcreateEmbeddedStringObject总结 createRawStringObject总结 createStringObjectFromLongDouble总结 createStringObjectFromLongLongWithOptions总结 相关操作sdscatlen总结 阈值44sds VS C字符串 前言 从…

微信这一功能全面升级,万万没想到

大家好,我是小悟 兄弟们,今天要说的是,复用已认证公众号资料快速注册已认证小程序的时代一去不复还了。 再从公众号快速注册小程序入口去注册小程序,注册后也是未认证的状态,需要单独付费认证。通过该方式注册的小程序…

案例:自定义下拉刷新动画(ArkTS)

文章目录 介绍相关概念完整示例代码结构解读 自定义下拉组件自定义刷新动画总结 介绍 本篇Codelab主要介绍组件动画animation属性设置。当组件的某些通用属性变化时,可以通过属性动画实现渐变效果,提升用户体验。 本Codelab使用的display接口处于mock阶…

私域新手必看:这可能是你最快速的入门指南!

一、认知层:为什么必须做私域? 了解这个问题,必须得观察一下中国现状。根据中国互联网络信息中心(CNNIC)发布第48次《中国互联网络发展状况统计报告》显示,截至 2021 年 6 月: 而典型电商平台的…

Transformers 2023年度回顾 :从BERT到GPT4

人工智能已成为近年来最受关注的话题之一,由于神经网络的发展,曾经被认为纯粹是科幻小说中的服务现在正在成为现实。从对话代理到媒体内容生成,人工智能正在改变我们与技术互动的方式。特别是机器学习 (ML) 模型在自然语言处理 (NLP) 领域取得…