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屋!