Hi,
I have two tables. In one are apartment data - "apart" table(site for renting apartments). In other are prices - "prices" table. There are more than one price for one apartment (from 01.8.2012- 31.08.2012 is 50 Eur, 01.09.2012 - 31.12.2012 is 45,...). Two tables are connected with rentalid field. I want to get only lowest price. I have query that gives me all prices for one apartment. I get for example apartment1 with price 50Eur, then again apartment1 with price 45Eur. I need only to show price 45Eur. Here is the code:
"SELECT apart.apname, apart.rentalid, apart.status, apart.statpicture, apart.peoplebasic, apart.sdescription, apart.picture1, apart.bedrooms, apart.maxpeople, apart.arem2, prices.grosspr from apart INNER JOIN prices ON apart.rentalid = prices.rentalid WHERE prices.pricedateto > Date() ORDER BY apart.apname"
Please help
Thanks
I have two tables. In one are apartment data - "apart" table(site for renting apartments). In other are prices - "prices" table. There are more than one price for one apartment (from 01.8.2012- 31.08.2012 is 50 Eur, 01.09.2012 - 31.12.2012 is 45,...). Two tables are connected with rentalid field. I want to get only lowest price. I have query that gives me all prices for one apartment. I get for example apartment1 with price 50Eur, then again apartment1 with price 45Eur. I need only to show price 45Eur. Here is the code:
"SELECT apart.apname, apart.rentalid, apart.status, apart.statpicture, apart.peoplebasic, apart.sdescription, apart.picture1, apart.bedrooms, apart.maxpeople, apart.arem2, prices.grosspr from apart INNER JOIN prices ON apart.rentalid = prices.rentalid WHERE prices.pricedateto > Date() ORDER BY apart.apname"
Please help
Thanks