En cours

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

Voir plus : asc it, fixing error sql syntax, edit quick text, error sql syntax feedback, 1064 error sql syntax

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

N° du projet : #8480195

Décerné à :

alimumtaz112

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

35 $ USD en 1 jour
(0 Commentaires)
0.0

3 freelance ont fait une offre moyenne de 27 $ pour ce travail

Rajitha7

if you can clearly mention the problem I think this will be easy task.I like to help you in this time.Hope you will offer the project to me

30 $ USD en 1 jour
(0 Commentaires)
0.0
renandocarmoreis

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

15 $ USD en 0 jours
(0 Commentaires)
0.0