Need a Quick Edit Made to SQL Syntax

I have an application that I\\\'m building and having some trouble with some SQL syntax that I need help with. \r\n\r\nMy database looks like this:\r\nid INT(11) AI\r\nclient_unit_id INT(11)\r\nuser_id INT(11)\r\nnumber_beds INT(11)\r\ncomment VARCHAR(2000)\r\ndate_changed DATETIME\r\n\r\nI need to return only the latest instance of the client_unit_id, with the user_id who updated it, their comment and the time_stamp. Right now, my SQL query is returning what I need, but only the old stuff and not the new:\r\n\r\n SELECT [url removed, login to view], u.unit_name, ua.number_beds, cu.total_beds, [url removed, login to view], ua.user_id, ua.date_changed\r\n FROM unit_availability AS ua\r\n INNER JOIN client_units AS cu ON cu.unit_id = ua.client_unit_id\r\n INNER JOIN units AS u ON [url removed, login to view] = cu.unit_id\r\n INNER JOIN clients AS c ON [url removed, login to view] = cu.client_id\r\n WHERE [url removed, login to view] = $clientId\r\n AND ua.client_unit_id IN (SELECT DISTINCT client_unit_id FROM unit_availability)\r\n GROUP BY ua.client_unit_id\r\n ORDER BY ua.date_changed ASC\r\n\r\nI would love to get this resolved today if possible! :)

Compétences : MySQL, SQL

en voir plus : asc it, fixing error sql syntax, edit photos gay stuff, 1064 error sql syntax cre loaded, 1064 error sql syntax orders, edit quick text, error sql syntax feedback, oscommerce error sql syntax check manual corresponds mysql, 1064 error sql syntax

Concernant l'employeur :
( 5 commentaires ) Arlington, United States

Nº du projet : #8480195

Décerné à:


Hi, It will be an honor for me to work with you. I will solve it today. Looking forward to hear from you.

%selectedBids___i_sum_sub_4% %project_currencyDetails_sign_sub_5% USD en 1 jour
(0 Commentaires)

3 freelance font une offre moyenne de $27 pour ce travail


if you can clearly mention the problem I think this will be easy task.I like to help you in this [login to view URL] you will offer the project to me

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% USD en 1 jour
(0 Commentaires)

Hello, let me fix your sql query. Please send me your sql query without the "\r\n\r\n" and I will fix it for you. thanks

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 0 jours
(0 Commentaires)