SELECT * FROM是否有快捷方式? [英] Is there a shortcut for SELECT * FROM?
问题描述
psql控制台中有许多有用的快捷方式,例如\d
或\l
.
我想知道SELECT * FROM table_name
是否有一个吗?
我经常将此查询用于学习目的,因此不必一直写select * from ...
会很有帮助.
There are many useful shortcuts in psql console like \d
or \l
.
I wondering is there one for SELECT * FROM table_name
?
I use this query often for learning purposes so it would be quite helpful not to have to write select * from ...
all the time.
推荐答案
在标准SQL中,SELECT * FROM
有一个快捷方式",因此可以在psql中使用它:
There is a "shortcut" for SELECT * FROM
in standard SQL, so you can use it in psql:
TABLE tablename;
此语法速记只能与有限范围的子句一起使用. 手册:
This syntax shorthand can only be used with a limited range of clauses. The manual:
它可用作顶级命令或节省空间的语法 复杂查询部分的变体.仅
WITH
,UNION
,INTERSECT
,EXCEPT
,ORDER BY
,LIMIT
,OFFSET
,FETCH
和FOR
锁定子句可以是 与TABLE
一起使用;WHERE
子句和任何形式的聚合都不能 被使用.
It can be used as a top-level command or as a space-saving syntax variant in parts of complex queries. Only the
WITH
,UNION
,INTERSECT
,EXCEPT
,ORDER BY
,LIMIT
,OFFSET
,FETCH
andFOR
locking clauses can be used withTABLE
; theWHERE
clause and any form of aggregation cannot be used.
这篇关于SELECT * FROM是否有快捷方式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!