Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/http/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Database 如何在informix中获得MS ACCESS的first()功能_Database_Informix - Fatal编程技术网

Database 如何在informix中获得MS ACCESS的first()功能

Database 如何在informix中获得MS ACCESS的first()功能,database,informix,Database,Informix,我有一个名为errors的表,它的列是error\u code,dep\u index 当我使用下面的查询时 select distinct dep_index, error_code from errors; 结果如下: 1000001 09 1000002 10 1000003 09 1000004 10 我首先尝试了dep_索引,但无法得到如下所示的预期结果。我只需要每个错误代码的第一个dep_索引。希望我能清楚地说明我的问题 1000001 09 1000002 10

我有一个名为errors的表,它的列是error\u code,dep\u index

当我使用下面的查询时

select distinct dep_index, error_code from errors; 
结果如下:

1000001  09
1000002  10
1000003  09
1000004  10
我首先尝试了dep_索引,但无法得到如下所示的预期结果。我只需要每个错误代码的第一个dep_索引。希望我能清楚地说明我的问题

1000001  09
1000002  10

假设
dep_index
是连续的,并且是递增的,然后使用
min()
来获取每个错误代码的最低值,应该执行您想要的操作:

选择min(dep_索引)作为min_dep_索引,按错误代码从错误组中选择错误代码