OpenSQL 中 GROUP BY 子句中的通配符? [英] Wildcards in GROUP BY clause in OpenSQL?

查看:30
本文介绍了OpenSQL 中 GROUP BY 子句中的通配符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个类似于下面的选择:

I have a select similar to the one below:

SELECT DISTINCT
  SCARR~CARRID,
  SCARR~CARRNAME,
  MIN( SPFLI~DISTANCE ) AS MIN_DISTANCE
FROM SCARR JOIN SPFLI ON SPFLI~CARRid = SCARR~CARRid
GROUP BY 
  SCARR~CARRID, 
  SCARR~CARRNAME
INTO TABLE @DATA(result).

在实际情况下,这些是其他表,我在 SELECTGROUP BY 中都有更多字段.

In the real case, these are other tables and I have many more fields in both SELECT and GROUP BY.

我是否可以简化GROUP BY 以便不必重新编写SCARR 表中SELECT 子句中的所有字段?

Can I simplify the GROUP BY to not have to write again all the fields that are in the SELECT clause from the table SCARR?

我知道其他选项是对表 SCARR 的所有字段使用 MIN 除了它的 ID,或者不使用 GROUP BY 而是删除选择后重复,但我试图做类似 GROUP BY Scarr~*

I know other options are to use MIN for all the fields of table SCARR except its ID, or not GROUP BY and instead remove duplicates after the select, but I was trying to do something like GROUP BY scarr~*

推荐答案

不,OpenSQL 语法不支持这一点.

这篇关于OpenSQL 中 GROUP BY 子句中的通配符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆