sql -- 如何解决 select in 中的项过多的问题
程序员文章站
2022-06-30 12:18:26
如果 select in 中包含的项过多,会严重影响程序的性能,解决方法为:注意 'admin,test' 为一个完整的字符串,而不是 'admin','test'select account,id,password from test t1 join( SELECT unnest(string_to_array('admin,test', ',')) as name) t2on t1.account = t2.name再举一个更复杂些的例子SELECTt1.ID,t2.r...
如果 select in 中包含的项过多,会严重影响程序的性能,解决方法为:
注意 'admin,test'
为一个完整的字符串,而不是 'admin','test'
select account,id,password from test t1
join
( SELECT unnest(string_to_array('admin,test', ',')) as name) t2
on t1.account = t2
本文地址:https://blog.csdn.net/weixin_38645718/article/details/107674597
下一篇: 查询Oracle表结构信息(走数模用)
推荐阅读
-
如何解决Mysql中中文乱码的问题
-
MySQL数据库中如何解决分组统计的问题_MySQL
-
javascript - 如何解决 header("WWW-Authenticate: Basic realm='你好'")弹框中中文乱码的问题?
-
html select 中的 option 下拉列表的宽度, IE8中不能自动适应宽度, 如何简单解决?_html/css_WEB-ITnose
-
javascript - 关于iscroll.js滚动容器中动态插入的元素无法滚动的问题,该如何解决?
-
javascript - 如何解决 header("WWW-Authenticate: Basic realm='你好'")弹框中中文乱码的问题?
-
浅谈MySQL数据库中如何解决分组统计的问题_MySQL
-
如何解决 UTF 文档中的乱码问题?
-
如何解决magento2安装过程中缺少两个php扩展的问题:ext-intl和ext-xsl
-
浅谈MySQL数据库中如何解决分组统计的问题_MySQL