Home > Database > Mysql Tutorial > How can we use MySQL SELECT without FROM clause?

How can we use MySQL SELECT without FROM clause?

王林
Release: 2023-09-10 09:37:02
forward
1121 people have browsed it

我们如何使用没有 FROM 子句的 MySQL SELECT?

#The FROM clause after the SELECT shows a reference to the table. But if there is no reference to any table, then we can use SELECT without FROM clause. In other words, we can say that SELECT can be used to retrieve rows calculated without referencing any table. Consider the following statement -

mysql> Select concat_ws(" ","Hello", "World");
+---------------------------------+
| concat_ws(" ","Hello", "World") |
+---------------------------------+
| Hello World                     |
+---------------------------------+
1 row in set (0.00 sec)

mysql> Set @var1=100;
Query OK, 0 rows affected (0.00 sec)

mysql> Select @var1;
+-------+
| @var1 |
+-------+
|   100 |
+-------+
1 row in set (0.00 sec)
Copy after login

The above is the detailed content of How can we use MySQL SELECT without FROM clause?. For more information, please follow other related articles on the PHP Chinese website!

source:tutorialspoint.com
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template