http://blog.csdn.net/c517984604/article/details/7052186 [Err] 1242 - Subquery returns more than 1 row   --表示子查询返回了多行数据

例如:

select * from table1 where table1.colums=(select columns from table2)

解决方法

1,select * from table1 where column=any(select columns  from table2)
2,select * from table1 where column in(select columns  from table2);
3,select * from table1 a where exists 
(select columns from tableb2 b
where b.column=a.column
);
 

解决"Subquery returns more than 1 row"sql查询错误的更多相关文章

  1. 错误代码: 1242 Subquery returns more than 1 row

    1. 错误描述 1 queries executed, 0 success, 1 errors, 0 warnings 查询:SELECT t.id, DATE_FORMAT( t.statisTim ...

  2. Subquery returns more than 1 row

    Subquery returns more than 1 row表示子查询返回了多行数据 例如: select * from table1 where table1.colums=(select co ...

  3. mysql 报错 ‘u'Subquery returns more than 1 row'’

    watch_course_sql ) , '%%Y-%%m-%%d %%T') regtime, a.username FROM bskuser a where a.UserName in (sele ...

  4. 报错注入遇到ERROR 1242 (21000): Subquery returns more than 1 row解决方案

    我的SQL语句是这样写的. mysql> select 1,2,3 and updatexml(1,concat(1,(select user from mysql.user),1),1);ER ...

  5. MYSQL --Subquery returns more than 1 row查询结果多于一行

    Subquery returns more than 1 row表示子查询返回了多行数据 例如: select * from table1 where table1.colums=(select co ...

  6. django错误笔记——1242 Subquery returns more than 1 row

    在数据库查询操作过程中,子查询结果不唯一,导致外面的查询无法进行. 我的错误语句: rid = models.User.objects.filter(username=username).values ...

  7. SQL server 查询出现:---“子查询返回的值不止一个。当子查询跟随在 =、!=、<、<=、>、>= 之后,或子查询用作表达式时,这种情况是不允许的。”SQL查询错误解析---

    最近用select进行数据筛选,碰到下面的这个错误: ---子查询返回的值不止一个.当子查询跟随在 =.!=.<.<=.>.>= 之后,或子查询用作表达式时,这种情况是不允许的 ...

  8. “子查询返回的值不止一个。当子查询跟随在 =、!=、<、<=、>、>= 之后,或子查询用作表达式时,这种情况是不允许的。”SQL查询错误解析

    为了实现下述代码,首先得有数据库和相应的表格,本文用的是https://blog.csdn.net/qaz13177_58_/article/details/5575711/中的案例,即先用链接中那些 ...

  9. SQL 查询性能优化----解决书签查找

    先来看看什么是书签查找: 当优化器所选择的非聚簇索引只包含查询请求的一部分字段时,就需要一个查找(lookup)来检索其他字段来满足请求.对一个有聚簇索引的表来说是一个键查找(key lookup), ...

随机推荐

  1. 【转】C#中的implicit 和 explicit

    The implicit and explicit keywords in C# are used when declaring conversion operators. Let's say tha ...

  2. Python杂技

    py转exe文件 用 pyinstaller,可以把所有文件打包成一个单独的exe文件 win10X64 =>pip install pyinstaller pyinstaller [参数] [ ...

  3. 洛谷P3327 [SDOI2015]约数个数和 【莫比乌斯反演】

    题目 设d(x)为x的约数个数,给定N.M,求\(\sum_{i = 1}^{N} \sum_{j = 1}^{M} d(ij)\) 输入格式 输入文件包含多组测试数据.第一行,一个整数T,表示测试数 ...

  4. java面试题之spring aop中jdk和cglib哪个动态代理的性能更好?

    在jdk6和jdk7的时候,jdk比cglib要慢: 在jdk8的时候,jdk性能得到提升比cglib要快很多: 结论出自:https://www.cnblogs.com/xuliugen/p/104 ...

  5. luogu 1354 房间最短路问题 线段与直线相交 最短路

    题目链接 题目描述 在一个长宽均为10,入口出口分别为(0,5).(10,5)的房间里,有几堵墙,每堵墙上有两个缺口,求入口到出口的最短路经. 输入输出格式 输入格式: 第一排为n(n<=20) ...

  6. Linux 设备驱动的固件加载【转】

    转自:http://blog.csdn.net/zqixiao_09/article/details/51106663 版权声明:本文为博主原创文章,未经博主允许不得转载. 作为一个驱动作者, 你可能 ...

  7. hdu 1242(搜索)

    Rescue Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Subm ...

  8. 001为什么Linux使用~作为家目录?为什么vim用hjkl作为方向键?

  9. 匿名块的四个类型(type rowtype record table)

    Oracle PL/SQL块 匿名块的四个类型 type rowtype record table ---- type (列类型)  %type类型是指声明变量的时候,参考某个表的某个列的类型---- ...

  10. Java-ArrayList使用技巧---从第一个List中去除所有第二个List中与之重复的元素

    需求:从 mAllList 中去除所有 mSubList 中与之重复的元素 测试数据:mAllList 中包含100000个无序无重复字符串,mSubList 中包含50000个无序无重复字符串 方法 ...