Several records in a table have, need to go under the name again after heavy according to the latest create_time took out all of the same name a
SELECT Associates. The username, Associates. Mobile, Associates. Sex, Associates. Id_card, Associates. Worker_source, C.com pany_name, B.N AME, A.S TATUS The FROM H_worker_contract a RIGHT JOIN h_worker associates ON aleem walji orker_id=associates. Id//need according to the requirements of this table out I said above LEFT the JOIN t_company c ON a.com pany_id=c.i d LEFT the JOIN h_job b ON a. ob_id=b.i d
Excuse me, on the basis of the SQL should be how to change
CodePudding user response:
Is the username will h_worker to weighing out all of the newly created with the same one
CodePudding user response:
Have not understand can ask, may I express is not very clear
CodePudding user response:
No one will be,,
CodePudding user response:
SELECT * The FROM ( SELECT ROW_NUMBER () OVER (PARTITION BY associates. The username ORDER BY create_time DESC) AS rids, Associates. The username, Associates. Mobile, Associates. Sex, Associates. Id_card, Associates. Worker_source, C.com pany_name, B.N AME, A.S TATUS The FROM H_worker_contract a RIGHT JOIN h_worker associates ON aleem walji orker_id=associates. Id - according to the requirements of this table out I said above LEFT the JOIN t_company c ON a.com pany_id=c.i d LEFT the JOIN h_job b ON a. ob_id=b.i d ) AS tt WHERE tt. Rids=1