Home >Database >Mysql Tutorial >How can we use MySQL SELECT without FROM clause?
#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)
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!