我正在尝试根据第一个查询中返回的行数组合 2 个 MySQL 查询,如下所示:
mysql_query("SELECT * FROM `new_userprofile_combined`
WHERE `upg_featured` >= NOW() LIMIT 20
IF mysql_num_rows(1st query) < 20
(SELECT * FROM `new_userprofile_combined`
WHERE `upg_featured` < NOW() ORDER BY rand()
LIMIT (20-mysql_num_rows(1st query))) ");
这可能吗?我该怎么做?