Q:

select from db sql query

I have this query : 
$query = mysql_query ("SELECT *
                         FROM saledb.application
                       WHERE app_id = (
                                       SELECT app_id
                                         FROM saledb.applicationdetails
                                        WHERE is_hot = '1'
                                      ) LIMIT $Kvet,$Zet
                      ");

And I have the following error:

Unable to save result set in
  /home/lemondo/lemondosales.itnovations.ge/content/tpl/gtpl/main.php on
  line 68

When I changing select item with MAX(app_id) it works but i need show all results. i know where is problem mysql cant choose in one query meny ID but i need alternativ query.

A:

Use the IN predicate instead of = like os:
SELECT * 
FROM saledb.application 
WHERE app_id IN
  (SELECT app_id 
   FROM saledb.applicationdetails 
   WHERE is_hot = '1');

