How to execute second query when first query has no results - MYSQL
P粉998100648
P粉998100648 2023-09-16 16:12:30
0
1
844

How to get results in MYSQL:

If the first selection has more than 0 rows, return the result, otherwise return the result of the second selection ( is not the same table , there is only one column in the two selections).

Something similar SELECT IF ((EXISTS(SELECT COLUMN 1 FROM TABLE 1)),(SELECT COLUMN 1 FROM TABLE 1),(SELECT COLUMN 1 FROM TABLE 2);

P粉998100648
P粉998100648

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!