Help Me with my SQL Query (Need it to always return at least one row.)
问题 First off, here's my SQL query: SELECT research_cost, tech_name, (SELECT research_cost FROM technologies WHERE research_cost <= USERS_RESEARCH_POINTS_VALUE ORDER BY research_cost DESC LIMIT 1) as research_prev, (SELECT cost FROM technology_costs WHERE id = 18 LIMIT 1) as technology_cost FROM `technologies` JOIN technology_costs ON id = COUNT_OF_TECHS_USER_LEARNED WHERE research_cost > USERS_RESEARCH_POINTS_VALUE ORDER BY research_cost ASC LIMIT 1 Website link: http://www.joemajewski.com