You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Databend, you can use the AS keyword to assign an alias to a column. This allows you to provide a more descriptive and easily understandable name for the column in both the SQL statement and the query result:
@@ -155,7 +142,7 @@ SELECT * EXCLUDE (id,lastname) FROM allemployees;
155
142
| Macy | F |
156
143
```
157
144
158
-
### COLUMNS
145
+
### COLUMNS Keyword
159
146
160
147
The COLUMNS keyword provides a flexible mechanism for column selection based on literal regular expression patterns and lambda expressions.
161
148
@@ -232,6 +219,27 @@ SELECT a, $2 FROM t1;
232
219
+---+-------+
233
220
```
234
221
222
+
### Retrieving All Columns
223
+
224
+
The `SELECT *` statement is used to retrieve all columns from a table or query result. It is a convenient way to fetch complete data sets without specifying individual column names.
225
+
226
+
This example returns all columns from my_table:
227
+
228
+
```sql
229
+
SELECT*FROM my_table;
230
+
```
231
+
232
+
Databend extends SQL syntax by allowing queries to start with `FROM <table>` without explicitly using `SELECT *`:
233
+
```sql
234
+
FROM my_table;
235
+
```
236
+
237
+
This is equivalent to:
238
+
239
+
```sql
240
+
SELECT*FROM my_table;
241
+
```
242
+
235
243
## FROM Clause
236
244
237
245
The FROM clause in a SELECT statement specifies the source table or tables from which data will be queried. You can also improve code readability by placing the FROM clause before the SELECT clause, especially when managing a lengthy SELECT list or aiming to quickly identify the origins of selected columns.
0 commit comments