.
¸ÇÀ§¿¡
À̸§ »óÅ ³¯Â¥
================
¾Æ¹«°³ null 05-11
È«±æµ¿ Ãâ±Ù 05-11
¾Æ¹«°³ Ãâ±Ù 05-10
È«±æµ¿ null 05-10
¿ä°Åó·³ »Ì¾Æ³»¾ß µÇ´Âµ¥¿ä
select s.name,d.date,c.sangtae
from sawon as s inner join
chul as c
on s.idx=c.s_idx
cross join date as d
À§¿¡ Äõ¸®·Î Çؼ ¾Æ·¡Ã³·³ Ãâ·Â±îÁö´Â Çß½À´Ï´Ù.
À̸§(name) »óÅÂ(sangtae) ³¯Â¥(date)
================
¾Æ¹«°³ Ãâ±Ù 05-11
È«±æµ¿ Ãâ±Ù 05-11
¾Æ¹«°³ Ãâ±Ù 05-10
È«±æµ¿ Ãâ±Ù 05-10
dateÅ×À̺íÀÇ idx¶û chulÅ×À̺íÀÇ d_idx¸¦ ºñ±³Çؼ °°Áö ¾ÊÀ¸¸é sangtae¸¦ null·Î ¹Ù²Ù¸é µÇÁö ¾ÊÀ»±î ½Í¾î¼
select s.name,d.date,c.sangtae
from sawon as s inner join
chul as c
on s.idx=c.s_idx
cross join date as d
where d.idx != c.d_idx c.sangtae is null;
¿ä·¸°Ôµµ Çغ¸°í Àú·¸°Ôµµ Çغôµ¥ ¾ÈµÇ´Âµ¥ mysql¿¡¼ ¸¸¾à¿¡ °°Áö¾ÊÀ¸¸é ¹¹¹¹·Î °íÄ£´Ù À̰Ÿ¦ ¾î¶»°Ô Ç¥ÇöÇÒ ¼ö ÀÖÀ»±î¿ä? | |
|
from date d cross join sawon s
left outer join chul c
on c.s_idx = s.idx and c.d_idx = d.idx
order by d.date desc, s.name;
°¨»çÇÕ´Ï´Ù .