æè¿ãSQLæãç´æ¥æ¸ãæ©ä¼ããã£ã¦ãä»ã¾ã§ã»ã¨ãã©å ¨ãSQLã«ã¤ãã¦åå¼·ããæ©ä¼ããªãã£ãã®ã§æ¥åã«é¢ä¿ã®ããã¨ãããå°ãããã£ã¦ã¿ããã¨ã«ã ä»ã¾ã§ããã«ActiveRecordå çã«ãä¸è©±ã«ãªã£ã¦ãããããããããã¾ããã ãã¦ãã¦ãããã§ã¯æ¬é¡ã INNER JOINã¨OUTER JOINã®éãã«ã¤ãã¦ç解ãæ·±ãã¦ããã¾ãã 以ä¸ã®ãã¼ãã«ã«å¯¾ãã¦SQLãçºè¡ãã¦ãã®çµæãè¦ã¦ãããã¨ã«ãã¾ãã mysql> select * from dogs; +----+-------+----------+ | id | name | owner_id | +----+-------+----------+ | 1 | aka | 1 | | 2 | ao | 2 | | 3 | shiro | 1 | | 4 | kuro | 4 | +----+-------+----------+
{{#tags}}- {{label}}
{{/tags}}