mysql-error-1054

Mysql subquery problem

Hi, I have 2 tables: loans (columns: id, user) payback (columns: id, installment, scheduleDate) If a loan is to be paid in 12 installments, then there are 12 payback records with loan id. I would like to find out what users have a scheduleDate on which the sum of all their paybacks is greater than 2000. SELECT user FROM {loans} ka...

Using INNER JOIN with MySQL on selecting multiple tables?

Hi all, I have a site where a specific set of data is collected. This is a travel agency website. It is neccesary to determine whether or not an accommodation is still bookable. When I don't select any searchfilters (like destination, classification, facilities etc) I get a working query. The looks like: SELECT `accommodation` . * FROM...