gpt4 book ai didi

mysql - 从两个sql查询中选择公共(public)结果

转载 作者:行者123 更新时间:2023-11-29 07:33:11 25 4
gpt4 key购买 nike

查询1:

Select route_stop.Route_ID from route_stop,stop where
route_stop.Stop_ID=stop.Stop_ID AND stop.Stop_Name='Agargaon'

查询2:

Select route_stop.Route_ID from route_stop,stop where
route_stop.Stop_ID=stop.Stop_ID AND stop.Stop_Name='Mirpur-12'

最佳答案

Select route_stop.Route_ID from route_stop,stop where route_stop.Stop_ID=stop.Stop_ID AND stop.Stop_Name='Agargaon'
Union
Select route_stop.Route_ID from route_stop,stop where route_stop.Stop_ID=stop.Stop_ID AND stop.Stop_Name='Mirpur-12'

要连接同一列,请使用联合

关于mysql - 从两个sql查询中选择公共(public)结果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31874542/

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