Oracle / PLSQL: ORA-01427

Learn the cause and how to resolve the ORA-01427 error message in Oracle.

Description

When you encounter an ORA-01427 error, the following error message will appear:

  • ORA-01427: single-row subquery returns more than one row

Cause

You tried to execute a SQL statement that contained a SQL subquery that returns more than one row.

Resolution

The option(s) to resolve this Oracle error are:

Option #1

Rewrite your query so that the subquery only returns one row.

Option #2

Change your query to use one of the following with your subquery results:

For example, if you tried to execute the following SQL statement:

SELECT *
FROM orders
WHERE supplier_id = (SELECT supplier_id
FROM suppliers
WHERE supplier_name = 'IBM');

And there was more than one record in the suppliers table with the supplier_name of IBM, you would receive the following message:

The most common way to correct this SQL statement is to use the IN conditionas follows:

SELECT *
FROM orders
WHERE supplier_id IN (SELECT supplier_id
FROM suppliers
WHERE supplier_name = 'IBM');

oracle-01427的更多相关文章

  1. Oracle Update 语句语法与性能分析 - 多表关联

    Oracle Update 语句语法与性能分析 - 多表关联   为了方便起见,建立了以下简单模型,和构造了部分测试数据: 在某个业务受理子系统BSS中, SQL 代码 --客户资料表 create ...

  2. ORACLE多表关联UPDATE 语句

    转载至:http://blog.itpub.net/29378313/viewspace-1064069/ 为了方便起见,建立了以下简单模型,和构造了部分测试数据:在某个业务受理子系统BSS中, SQ ...

  3. ORACLE 多表关联 UPDATE 语句

    为了方便起见,建立了以下简单模型,和构造了部分测试数据: 在某个业务受理子系统BSS中, SQL 代码 --客户资料表 create table customers ( customer_id num ...

  4. Oracle update 两表及以上关联更新,出现多值情况,不是一对一更新

    为了方便起见,建立了以下简单模型,和构造了部分测试数据:在某个业务受理子系统BSS中, SQL 代码--客户资料表 create table customers ( customer_id numbe ...

  5. Oracle分析函数入门

    一.Oracle分析函数入门 分析函数是什么?分析函数是Oracle专门用于解决复杂报表统计需求的功能强大的函数,它可以在数据中进行分组然后计算基于组的某种统计值,并且每一组的每一行都可以返回一个统计 ...

  6. Linux平台 Oracle 10gR2(10.2.0.5)RAC安装 Part3:db安装和升级

    Linux平台 Oracle 10gR2(10.2.0.5)RAC安装 Part3:db安装和升级 环境:OEL 5.7 + Oracle 10.2.0.5 RAC 5.安装Database软件 5. ...

  7. Linux平台 Oracle 10gR2(10.2.0.5)RAC安装 Part1:准备工作

    Linux平台 Oracle 10gR2(10.2.0.5)RAC安装 Part1:准备工作 环境:OEL 5.7 + Oracle 10.2.0.5 RAC 1.实施前准备工作 1.1 服务器安装操 ...

  8. Oracle 的基本操作符

    != 不等于 select empno,ename,job from scott.emp where job!='manager' ^= 不等于 select empno,ename,job from ...

  9. 使用Zabbix监控Oracle数据库

    Orabbix介绍 监控Oracle数据库我们需要安装第三方提供的Zabbix插件,我们先测试比较有名的Orabbix,http://www.smartmarmot.com/product/orabb ...

  10. 基于Oracle安装Zabbix

    软件版本 Oracle Enterprise Linux 7.1 64bit Oracle Enterprise Edition 12.1.0.2 64bit Zabbix 3.2.1 准备工作 上传 ...

随机推荐

  1. ubuntu下永久修改DNS

    通过修改: sudo vi /etc/resolvconf/resolv.conf.d/base(这个文件默认是空的) 在里面插入: nameserver 8.8.8.8 nameserver 8.8 ...

  2. FFmpeg库简介

    1.FFmpeg基本组成 FFmpeg框架的基本组成包含AVFormat.AVCodec.AVFilter.AVDevice.AVUtils等模块库,如下图所示. libavformat:用于各种音视 ...

  3. <转> win7下破解已安装的VS2008

    http://renfan.blog.51cto.com/3466724/754301 在win7系统下,已安装的VS2008维护界面是不显示序列号输入的,需要按以下步骤进行才能破解 1.点击“卸载/ ...

  4. 【原】Coursera—Andrew Ng机器学习—Week 11 习题—Photo OCR

    [1]机器学习管道 [2]滑动窗口 Answer:C ((200-20)/4)2 = 2025 [3]人工数据 [4]标记数据 Answer:B (10000-1000)*10 /(8*60*60) ...

  5. 封装baseControl

    package com.huawei.base; import java.io.IOException;import java.io.OutputStream;import java.io.Print ...

  6. Lambert模型

    [Lambert模型] 漫反射光的强度近似地服从于Lambert定律,即漫反射光的光强仅与入射光的方向和反射点处表面法向夹角的余弦成正比. 由此可以构造出Lambert漫反射模型:Idiffuse = ...

  7. 把http网站改为Https网站

    腾讯云申请完证书后添加到服务器的方法: https://www.qcloud.com/document/product/400/4143#2.-nginx.E8.AF.81.E4.B9.A6.E9.8 ...

  8. cdoj915-方老师的分身 II (长度不小于k的最短路)【spfa】

    http://acm.uestc.edu.cn/#/problem/show/915 方老师的分身 II Time Limit: 10000/5000MS (Java/Others)     Memo ...

  9. Eclipse创建javaWeb项目工程

    首先,想作为一个较为标准的程序员,应该把自己的开发工具eclipse设置成与公司中大多数程序员的设置一样,比如说工作的字符编码为UTF-8,字体大小等等. 在刚下载好的eclipse中刚进去是没有To ...

  10. Canny效果