»Ë»Ñ Æ÷·³
°³¹ßÀÚÆ÷·³ ÀÔ´Ï´Ù.
  • ºÏ¸¶Å© ¾ÆÀÌÄÜ

mysql join¿¡¼­ Á¶°Ç Áú¹®ÀÔ´Ï´Ù.2

.

1432571730_image.jpg



¸ÇÀ§¿¡

À̸§    »óÅ   ³¯Â¥
================
¾Æ¹«°³  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¿¡¼­ ¸¸¾à¿¡ °°Áö¾ÊÀ¸¸é ¹¹¹¹·Î °íÄ£´Ù À̰Ÿ¦ ¾î¶»°Ô Ç¥ÇöÇÒ ¼ö ÀÖÀ»±î¿ä?

0
ÃßõÇϱ⠴ٸ¥ÀÇ°ß 0
|
°øÀ¯¹öÆ°
÷ºÎÆÄÀÏ
  • 1432571730_image.jpg

´Ù¸¥ÀÇ°ß 0 Ãßõ 0 ¾Ö±³°áÇÌ

´Ù¸¥ÀÇ°ß 0 Ãßõ 0 °íÃ߸԰í¸É¸É
  • ¾Ë¸² ¿å¼³, »óó ÁÙ ¼ö ÀÖ´Â ¾ÇÇÃÀº »ï°¡ÁÖ¼¼¿ä.
©¹æ »çÁø  
¡â ÀÌÀü±Û¡ä ´ÙÀ½±Û ¸ñ·Ïº¸±â