Skip to content

Instantly share code, notes, and snippets.

@enlacee
Created August 7, 2014 16:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save enlacee/c80c6c637205ca275d93 to your computer and use it in GitHub Desktop.
Save enlacee/c80c6c637205ca275d93 to your computer and use it in GitHub Desktop.
mysql - query : inner join
/**
* Sql indicator only exist data in c_tool
* if true make join success.
* ------------------------------
* SQL inner join fuera de lo normal
*/
SELECT t.* FROM c_tool t
INNER JOIN (
SELECT c_id, MAX(id) as id
FROM c_tool
GROUP BY c_id
) tmp ON tmp.c_id = t.c_id AND tmp.id = t.id;
@enlacee
Copy link
Author

enlacee commented Aug 7, 2014

sql no comun souce 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment