gpt4 book ai didi

mysql - 选择 MIN/MAX 列经纬度

转载 作者:行者123 更新时间:2023-11-29 06:45:49 27 4
gpt4 key购买 nike

我有一个看起来像这样的专栏

enter image description here

如何获得最小值和最大值?

这是期望值,右侧是排序后的值

enter image description here

最佳答案

Select membername From
(Select membername,
substring_index ( membername,',',1)+substring_index ( membername,',',-1) as total
From Table1) T1
Inner Join
(
Select Max(total) total1,Min(total) total2 From (
SELECT membername,
substring_index ( membername,',',1)+substring_index ( membername,',',-1) as total
From Table1)T) T2
ON T1.total=T2.total1
OR T1.total=T2.total2

现场演示

http://sqlfiddle.com/#!9/5f6410/1

关于mysql - 选择 MIN/MAX 列经纬度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49526494/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com