如何在Oracle中选择SELECT * TABLE列? [英] How to SELECT Column, * FROM TABLE in Oracle?
问题描述
我正在创建许多脚本,有时要检查表是否根据需要进行更新,我即时编写了一些SELECT语句.
I am creating a lot of scripts, and sometimes to check that the tables are being updated as I need, I write on the fly several SELECT statements.
在SQL SERVER中,您可以编写如下内容:
In SQL SERVER you can write something like:
SELECT Column1, *
FROM MY_TABLE
这出于可见性原因很有用,但是在ORACLE中似乎不起作用,而且我不知道如何实现,除了手动写下所有列名.
This is useful for visibility reasons, however that doesn't seem to work in ORACLE and I don't know how to achieve it, other than writing down all the Column Names manually.
如何在oracle中做到这一点?
我知道我们不应该在生产脚本等中包含这样的查询.在开发中运行脚本时,我只是试图即时使用它.在不同的时候,我更感兴趣的是查看某些列相对于其他列的信息,但是我仍然想查看所有列.
I know we shouldn't include a query like this in our production scripts, etc. I am just trying to use it on the fly while I am running my scripts in development. At different points I'm more interested to see the information of certain columns, in relation to the other ones, but I still want to see all the columns.
推荐答案
SELECT Column1, MY_TABLE.*
FROM MY_TABLE
或者,如果您为表指定别名:
Or if you give the table an alias:
SELECT Column1, T.*
FROM MY_TABLE T
这篇关于如何在Oracle中选择SELECT * TABLE列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!