Home > Database > Mysql Tutorial > Is There a Shortcut for `SELECT * FROM table_name` in psql?

Is There a Shortcut for `SELECT * FROM table_name` in psql?

Susan Sarandon
Release: 2025-01-13 19:17:44
Original
369 people have browsed it

Is There a Shortcut for `SELECT * FROM table_name` in psql?

*Shortcut for `SELECT FROM` in psql**

psql provides many convenient shortcuts, such as d and l. But is there a dedicated shortcut for the commonly used query SELECT * FROM table_name?

The answer is yes, in standard SQL there is a shorthand form for this query:

<code class="language-sql">TABLE tablename;</code>
Copy after login

However, this syntax can only be used in a limited number of clauses. According to the manual:

It can be used as a top-level command or as a space-saving syntax variant for parts of complex queries. Only the WITH, UNION, INTERSECT, EXCEPT, ORDER BY, LIMIT, OFFSET, FETCH, and FOR locking clauses can be used with TABLE; neither the WHERE clause nor any form of aggregation can be used.

The above is the detailed content of Is There a Shortcut for `SELECT * FROM table_name` in psql?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template