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

查看:196
本文介绍了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:

它可用作顶级命令或节省空间的语法 复杂查询部分的变体.仅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天全站免登陆