\crosstabview
Executes the current query buffer (like \g ) and shows the results in a crosstab grid. The query must return at least three columns. The output column identified by colV becomes a vertical header and the output column identified by colH becomes a horizontal header. colD identifies the output column to display within the grid. sortcolH identifies an optional sort column for the horizontal header.
当前阅读 PG 18·选择有来源记录的版本
此版本暂无所选语言的定义,以下显示原始英文内容。
- Client
- psql 18.6
- Case-sensitive spelling
- \crosstabview
- command
- \crosstabview
- manual path
- app-psql.html#APP-PSQL-META-COMMANDS-CROSSTABVIEW
- modifiers
- 未知
- signature
- \crosstabview [ colV [ colH [ colD [ sortcolH ] ] ] ]
- spellings
- \crosstabview
版本定义 PG 18
\crosstabview [colV[colH[colD[sortcolH] ] ] ]-
Executes the current query buffer (like
\g) and shows the results in a crosstab grid. The query must return at least three columns. The output column identified bycolVbecomes a vertical header and the output column identified bycolHbecomes a horizontal header.colDidentifies the output column to display within the grid.sortcolHidentifies an optional sort column for the horizontal header.Each column specification can be a column number (starting at 1) or a column name. The usual SQL case folding and quoting rules apply to column names. If omitted,
colVis taken as column 1 andcolHas column 2.colHmust differ fromcolV. IfcolDis not specified, then there must be exactly three columns in the query result, and the column that is neithercolVnorcolHis taken to becolD.The vertical header, displayed as the leftmost column, contains the values found in column
colV, in the same order as in the query results, but with duplicates removed.The horizontal header, displayed as the first row, contains the values found in column
colH, with duplicates removed. By default, these appear in the same order as in the query results. But if the optionalsortcolHargument is given, it identifies a column whose values must be integer numbers, and the values fromcolHwill appear in the horizontal header sorted according to the correspondingsortcolHvalues.Inside the crosstab grid, for each distinct value
xofcolHand each distinct valueyofcolV, the cell located at the intersection(x,y)contains the value of thecolDcolumn in the query result row for which the value ofcolHisxand the value ofcolVisy. If there is no such row, the cell is empty. If there are multiple such rows, an error is reported.
精确保留大小写的命令写法
\crosstabview
Spellings in this manual definition
| Command | Documented suffix modifiers |
|---|---|
| \crosstabview | None listed in this signature |
比较版本
来源引用
定义来源
center · PostgreSQL 18 · ee8d1a3612338fd9adf250730cb640fcc5233b5491337cc00a316a44e3a0b9f8
正文语言: en · ee8d1a3612338fd9adf250730cb640fcc5233b5491337cc00a316a44e3a0b9f8