---
title: "ORA-01422: 实际返回的行数超出请求的行数"
author: "ozzzo"
date: "2009-07-22T15:28:34Z"
tags: ["C", "C#", "C++", "Oracle"]
slug: "ora-01422"
draft: false
lastmod: "2009-07-22T15:28:47Z"
id: 430855
url: "https://ozzzo.iteye.com/blog/430855"
---

在ORACLE的存储过程 或是触发器中使用类似

 

select t.ajay into aytemp from t\_xyr\_collect t where t.c\_ahpx like '%'||xyrbh||'%' ;

 

的语句时,可能会出现ORA-01422: 实际返回的行数超出请求的行数 的错误

 

解决办法:在条件后加上  and rownum=1

 

如:

select t.ajay into aytemp from t\_xyr\_collect t where t.c\_ahpx like '%'||xyrbh||'%' and rownum=1;