Home >Database >Mysql Tutorial >What is the symbol that represents all columns in sql

What is the symbol that represents all columns in sql

醉折花枝作酒筹
醉折花枝作酒筹Original
2021-07-12 14:36:355172browse

The symbol in sql that represents all columns is the % in the wildcard character. Wildcard characters can be used to replace any other character in a string to search for data in a table. Used with the LIKE operator in SQL.

What is the symbol that represents all columns in sql

The operating environment of this tutorial: windows7 system, mysql8 version, Dell G3 computer.

Wildcard characters can be used to replace any other characters in a string.

SQL Wildcards

In SQL, wildcards are used with the SQL LIKE operator.

SQL wildcards are used to search for data in a table.

In SQL, you can use the following wildcards:

What is the symbol that represents all columns in sql

Example:

mysql> SELECT * FROM Websites;
+----+---------------+---------------------------+-------+---------+
| id | name          | url                       | alexa | country |
+----+---------------+---------------------------+-------+---------+
|  1 | Google        | https://www.google.cm/    |     1 | USA     |
|  2 | 淘宝          | https://www.taobao.com/   |    13 | CN      |
|  3 | 菜鸟教程      | http://www.runoob.com/    |  5000 | USA     |
|  4 | 微博          | http://weibo.com/         |    20 | CN      |
|  5 | Facebook      | https://www.facebook.com/ |     3 | USA     |
|  7 | stackoverflow | http://stackoverflow.com/ |     0 | IND     |
+----+---------------+---------------------------+-------+---------+

Use SQL % wildcards

Below The SQL statement selects all websites whose URL starts with the letters "https":

SELECT * FROM Websites
WHERE url LIKE 'https%';

Execution output result:

What is the symbol that represents all columns in sql

Related recommendations: "mysql tutorial

The above is the detailed content of What is the symbol that represents all columns in sql. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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