Created
March 23, 2016 07:07
-
-
Save fabiotatsuo/672174ac209ff5160cde to your computer and use it in GitHub Desktop.
Query one to many mysql
This file contains hidden or 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
use databse; | |
SELECT | |
n.id as noticia_id, | |
n.titulo as post_title, | |
n.categoria_noticia_id as categoria_noticia_id, | |
c.nome as tag_name | |
FROM noticia as n | |
LEFT JOIN categoria_noticia as c ON c.id = n.categoria_noticia_id |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment