Oracle DB简单SELECT列顺序很重要 [英] Oracle DB simple SELECT where column order matters
问题描述
我在Oracle DB中执行一个简单的SELECT语句,需要按照特定的顺序选择列。示例:
表A有100个属性,其中之一是章,按照表中列的顺序出现在某处。我需要选择数据与章第一和其余的列之后没有特定的顺序。基本上,我的语句需要读取如下:
选择a.chapter,a。 FROM A
此外,我不能输入:a.chapter,a。*
因为这会两次选择chapter。
我知道SQL语句似乎很简单,但如果我知道如何解决这个问题,我可以将这个想法推广到更复杂的领域。此外,让我们假设我不能只是滚动查找章列并将其拖动到开头。
感谢
您最好的选择是明确选择每一列。
I am doing a simple SELECT statement in an Oracle DB and need to select the columns in a somewhat-specific order. Example:
Table A has 100 attributes, one of which is "chapter" that occurs somewhere in the order of columns in the table. I need to select the data with "chapter" first and the remaining columns after in no particular order. Essentially, my statement needs to read something like:
SELECT a.chapter, a. the remaining columns FROM A
Furthermore, I cannot simply type:
SELECT a.chapter, a.*
because this will select "chapter" twice
I know the SQL statement seems simple, but if I know how to solve this problem, I can extrapolate this thought into more complicated areas. Also, let's assume that I can't just scroll over to find the "chapter" column and drag it to the beginning.
Thanks
Your best bet is just to select each column explicitly.
这篇关于Oracle DB简单SELECT列顺序很重要的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!