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

数据库编程大赛:一条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.rhkb.cn/news/234620.html

如若内容造成侵权/违法违规/事实不符,请联系长河编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

EtherCAT主站SOEM -- 13 --Qt-Soem通过界面按键控制 EtherCAT IO模块的io输出

EtherCAT主站SOEM -- 13 --Qt-Soem通过界面按键控制 EtherCAT IO模块的io输出 一 mainwindow.c 文件函数:1.1 自定义PDO配置2.2 主站初始化2.3 去motrorcontrol界面二 motrorcontrol.c 文件三 allvalue.h 文件该文档修改记录:总结一 mainwindow.c 文件函数: mainwindow主界…

20240105移远的4G模块EC20在Ubuntu 20.04.6 LTS下使用联通5G卡上网的步骤

20240105移远的4G模块EC20在Ubuntu 20.04.6 LTS下使用联通5G卡上网的步骤 2024/1/5 10:11 缘起:需要在Firefly的AIO-3399J开发板上调试移远的4G模块EC20(Android10/11/12),需要现在先测试EC20的好坏! 陶老板告诉我找一…

PPT插件-大珩助手-免费功能-特殊格式介绍

上、下标切换 直接切换选中的字符为上、下标。 大小金额 支持超大金额的大写金额转换 当前日期 本次打开文件的时间 转二维码 将当前选中的文字,转为二维码图片,并插入到PPT当前位置 特殊字符 内置常用的特殊字符,点击使用 软件介绍 …

致命勒索|揭秘2023年度十大勒索团伙

2023年,全球数字化转型加速 ,5G网络以及人工智能的高速发展,都给网络安全带来了新的挑战 。受地缘政治因素及疫情影响,国际局势动荡不安,经济衰退, 越来越多的网络攻击组织建立了高效的商业模式&#xff0c…

你们做外贸主要的获客渠道有哪些?

昨天跟一个同行朋友聊天,他原本主打产品是做动力类的,这两年竞争太大,订单也减少了很多。为了求发展,就拓品了,而拓展的新品刚好是我们这一块,而且非常迅速地找到场地把生产线弄了起来,还不断扩…

mysql原理--InnoDB的Buffer Pool

1.缓存的重要性 对于使用 InnoDB 作为存储引擎的表来说,不管是用于存储用户数据的索引(包括聚簇索引和二级索引),还是各种系统数据,都是以 页 的形式存放在 表空间 中的,而所谓的 表空间 只不过是 InnoDB 对…

将Django项目从本地上传至宝塔服务器(踩坑记录)

文章目录 写在前面配置本地文件配置宝塔面板解决遇到问题展示运行结果热门文章 自我介绍 ⭐2022年度CSDN 社区之星 Top6 ⭐2023年度CSDN 博客之星 Top16 ⭐2023年度CSDN 城市之星 Top2(苏州) ⭐CSDN Python领域 优质创作者 ⭐CSDN 内容合伙人 推荐热门…

Dockerfile语法和简单镜像构建

Dockerfile是一个用于定义Docker镜像的文本文件,包含了一系列的指令和参数,用于指示Docker在构建镜像时应该执行哪些操作,例如基于哪个基础镜像、复制哪些文件到镜像中、运行哪些命令等。 Dockerfile文件的内容主要有几个部分组成&#xff0c…

Python - 深夜数据结构与算法之 Two-Ended BFS

目录 一.引言 二.双向 BFS 简介 1.双向遍历示例 2.搜索模版回顾 三.经典算法实战 1.Word-Ladder [127] 2.Min-Gen-Mutation [433] 四.总结 一.引言 DFS、BFS 是常见的初级搜索方式,为了提高搜索效率,衍生了剪枝、双向 BFS 以及 A* 即启发式搜索…

pyqt调用UI和开启子进程

UI制作 qrc 注意调用UI前把样式表里绑定的资源(qrc)转换成py导入进去 xxx.qrc转xxx.py 两种方法 1命令 pyrcc5 -o icons_rc.py icons.qrc 2外部工具pyrcc 实参 -o $FileNameWithoutExtension$.py $FileNameWithoutExtension$.qrcsdz.qrc→→sdaz.py 在代码里写 import…

【模拟IC学习笔记】 采样保持电路的设计

目录 采样保持工作原理 概念 时域响应-采保信号 采样网络的KT/C噪声 采样电容大小的选取 采样抖动(jitter) jitter对SNR的影响 法一 法二 采样开关的种类 单MOS管 实践:Nmos导通电阻 传输门 栅压自举开关 采样技术 上极板采样 下极板采样 采样保持…

数据库的导入导出以及备份

1.数据库的导出和导入 一.navicat导入导出 导入:右键➡运行SQL文件 导出选:中要导出的表➡右键➡转储SQL文件➡数据和结构 mysqldump命 1. 进入navicat安装目录的bin目录,cmd打开命令窗口 2. mysql -u用户名 -p ➡ 输入密码 3. creat…

v-if控制div内容显示,克隆这个div但是v-if没有效果

问题描述: 我的子页面打印的时候通过isPdf来隐藏“选择参加人员”按钮。 我子页面有个el-dialog,el-dialog里面有个大的div它的id为app-pre-meet-add,在子页面我通过isPdf来显示我想要的内容。现在我在父页面先通过this.$refs.child.control…

虚拟主机 如何上传大于100M的文件 php网站程序

问题 虚拟主机上传文件大小限制100m, 有时会遇到非常大的文件上传,上传过程中耗时非常久, 可能服务器的限制设置了上传文件尺寸,返回“413 request entity too large” 整体逻辑 前端:上传文件时,进行文…

使用Windbg静态分析dump文件的一般步骤详解

目录 1、概述 2、静态分析dump文件的一般步骤 2.1、查看异常类型 2.2、使用.ecxr命令切换到发生异常的线程上下文,查看发生异常的那条汇编指令 2.3、使用kn/kv/kp命令查看异常发生时的函数调用堆栈 2.4、使用lm命令查看模块的时间戳,找到对应的pdb…

状态管理小能手:Cookie 和 Session

1. 引言 大家好,我是小❤,一个漂泊江湖多年的 985 非科班程序员,曾混迹于国企、互联网大厂和创业公司的后台开发攻城狮。 假期抢票的尴尬事件 最近小❤在抢出行的高铁票时,发生了一件尴尬的事情。 这不是临近假期了嘛&#xf…

WPF真入门教程26--项目案例--欧姆龙PLC通讯工具

1、案例介绍 前面已经完成了25篇的文章介绍,概括起来就是从0开始,一步步熟悉了wpf的概念,UI布局控件,资源样式文件的使用,MVVM模式介绍,命令Command等内容,这节来完成一个实际的项目开发&#…

MIB 变更周期

MIB 始终以 80 ms 的周期在 BCH 上传输并在 80 ms 内重复,并且它包括从小区获取 SIB1 所需的参数;如果 SSB 的周期大于 80 ms,则 MIB 的发送周期与 SSB 的周期相同。 在UE初始搜索时,SSB在半帧内的周期是20ms;所以对于…

鸿蒙开发基础-UIAbility内页面间的跳转

基于Stage模型下的UIAbility开发,实现UIAbility内页面间的跳转和数据传递。 创建两个页面 启动DevEco Studio,创建一个新工程。在工程pages目录中,选中Index.ets,点击鼠标右键 > Refactor > Rename,改名为Inde…

如何配置 VS Code 实现 git 密码免输入

目录 问题描述尝试过的失败方法问题分析最终采用的解决方案:利用 ssh key 提供密码免输入功能安装 git windows 命令工具在windows本地生成 ssh key将公钥安装到 git 服务器第一种方法第二种方法调试方法 参考资料: 问题描述 在 Windows 上,使用 Visual…