SELECT * FROM 有快捷方式吗? [英] Is there a shortcut for SELECT * FROM?

查看:28
本文介绍了SELECT * FROM 有快捷方式吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

psql 控制台中有许多有用的快捷方式,例如 dl.
我想知道 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:

它可以用作顶级命令或节省空间的语法复杂查询部分的变体.只有WITHUNIONINTERSECTEXCEPTORDER BYLIMITOFFSETFETCHFOR 锁定子句可以与 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 and FOR locking clauses can be used with TABLE; the WHERE clause and any form of aggregation cannot be used.

这篇关于SELECT * FROM 有快捷方式吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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