Hi all, I am having this problem with a new system that I am building for listing downloads. It consists of 3 tables Info: que => Where all the downloads are stored before that are approved of an administrator sites =>The list of sites that have submitted the downloads downloads => where the approved downloads are Structure: que=> download_id, download_type, download_title, site_id sites => site_id, site_name, site_url, site_rating, email downloads => download_id, download_type, download_title, site_id I am now looking to display all the downloads in que sorted by site_rating DESC and then later on also insert them in this way in the downloads table so that the highest rated sites are above the lower rated ones. Help would be appreciated. Regards, TheBiaatch
Hello TheBiaatch, To display the download list in que table sorted by site_rating DESC you can use this SELECT statement. SELECT que.*, sites.* FROM que, sites WHERE que.site_id = sites.site_id ORDER BY sites.site_rating DESC; Later you can use a INSERT statement to insert data into downloads table, you dont have to sort data while inserting them as you can retrieve the data in a sorted order for listing or display. eg: SELECT downloads.*, sites.* FROM downloads, sites WHERE download.site_id = sites.site_id ORDER BY sites.site_rating DESC; Hope you got your anwser. Regards, Gonzo