Created
August 7, 2014 16:41
-
-
Save enlacee/c80c6c637205ca275d93 to your computer and use it in GitHub Desktop.
mysql - query : inner join
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sql no comun souce 👍