Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use wildcards in the SELECT clause in SQLite

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

The editor would like to share with you how to use wildcards in the SELECT clause in SQLite. I hope you will get something after reading this article. Let's discuss it together.

The SELECT clause in SQLite uses wildcards

Two wildcards, * and table_name.*, are supported in the SELECT clause. Where the * wildcard outputs all user-defined columns of each source table in the FROM clause. For example, the following SQL statement outputs all user-defined columns for Students.

SELECT * FROM Students

Run the program, and the execution effect is shown in figure 3.5.

Figure 3.5 * wildcard

Table_name.* can be used to specify the name of the table where the output column is located, where the output columns are user-defined. Although both * and table_name.* wildcards can output multiple columns, neither of them will output automatically generated ROWID columns. If you want to output both ROWID and user-defined columns, you need to specify the ROWID column manually. The syntax is as follows:

SELECT ROWID, * FROM table_name

For example, the following SQL statement outputs all the columns in the Students table, including the automatically generated ROWID column.

SELECT ROWID,* FROM Students

Run the program, and the execution effect is shown in figure 3.6.

Figure 3.6 outputs all columns

Note: wildcards cannot use column aliases because they usually return multiple columns.

After reading this article, I believe you have some understanding of "how to use wildcards in SELECT clauses in SQLite". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report