|
 | ̤²ò·è |
 | ²ò·è |
 | Ää»ß |
 | ºï½üÍ×ÀÁ |
|
2019/9/5(Thu) 16:53:16|NO.88329
/*
´Êñ¤Ê²¾Áۥơ¼¥Ö¥ë¤Ç¤¹¡£
*/
;¢£¥¦¥£¥ó¥É¥¦½é´üÀßÄê
screen 0,1200,700,0,0,0
#include "sqlele.hsp"
// DB¥ª¡¼¥×¥ó //
sql_open ":memory:"
;¢£ A (¥Æ¡¼¥Ö¥ë : ¥³¥é¥à¿ô Ìó30 : ¥ì¥³¡¼¥É¿ô Ìó30Ëü·ï)
sql_q "create table A(ÃÏ°è, ¾ì½ê, Ź̾, ǯ·îID, ǯ·îÆüID)"
sql_q "insert into A values('´ØÅì', 'Åìµþ', 'ËãÉÛ', 'Åìµþ201001', 'Åìµþ20100101')"
sql_q "insert into A values('´ØÅì', 'ºë¶Ì', 'ÂçµÜ', 'ºë¶Ì201001', 'ºë¶Ì20100102')"
sql_q "insert into A values('´ØÀ¾', 'Âçºå', 'ÇßÅÄ', 'Âçºå201001', 'Âçºå20100103')"
sql_q "insert into A values('´ØÅì', 'Åìµþ', 'ËãÉÛ', 'Åìµþ201907', 'Åìµþ20190705')"
sql_q "insert into A values('´ØÅì', 'ºë¶Ì', 'ÂçµÜ', 'ºë¶Ì201908', 'ºë¶Ì20190805')"
sql_q "insert into A values('´ØÀ¾', 'Âçºå', 'ÇßÅÄ', 'Âçºå201909', 'Âçºå20190905')"
;¢£ B (¥Æ¡¼¥Ö¥ë : ¥³¥é¥à¿ô 5 : ¥ì¥³¡¼¥É¿ô Ìó2,000·ï)
sql_q "create table B(ÈÎÇä integer, ¸¶²Á integer, ñ²Á integer, ǯ·îID, ǯ·îÆüID)"
sql_q "insert into B values(2000, 1000, 3000, 'Åìµþ201001', 'Åìµþ20100101')"
sql_q "insert into B values(2500, 1100, 3100, 'ºë¶Ì201908', 'ºë¶Ì20190805')"
sql_q "insert into B values(3000, 1200, 3200, 'Âçºå201909', 'Âçºå20190905')"
;¢£ C (¥Æ¡¼¥Ö¥ë : ¥³¥é¥à¿ô Ìó30 : ¥ì¥³¡¼¥É¿ô Ìó30,000·ï)
sql_q "create table C(Çä¾å integer, ¿Í°÷ integer, µëÍ¿ integer, ǯ·îID)"
sql_q "insert into C values(6000, 13, 2600, 'Åìµþ201001')"
sql_q "insert into C values(7750, 10, 2100, 'ºë¶Ì201908')"
sql_q "insert into C values(9600, 15, 3200, 'Âçºå201909')"
sql_q "select * from A"
su=stat
mes "¢£ A (¥Æ¡¼¥Ö¥ë : ¥³¥é¥à¿ô Ìó30 : ¥ì¥³¡¼¥É¿ô Ìó30Ëü·ï)"
mes "¨®¨¬¨¬¨¸¨¬¨¬¨¸¨¬¨¬¨¸¨¬¨¬¨¬¨¬¨¸¨¬¨¬¨¬¨¬¨¬¨¸¨¬¨¬¨¬¨¬¨¬¨¬¨¯"
mes "¨Ãϰ訢¾ì½ê¨¢Å¹Ì¾¨¢¡¦¡¦¡¦¡¦¨¢¡¡Ç¯·îID¡¡¨¢¡¡Ç¯·îÆüID¡¡¨"
mes "¨²¨¬¨¬¨»¨¬¨¬¨»¨¬¨¬¨»¨¬¨¬¨¬¨¬¨»¨¬¨¬¨¬¨¬¨¬¨»¨¬¨¬¨¬¨¬¨¬¨¬¨´"
repeat su
mesA = "¨"+sql_v("ÃÏ°è")+"¨¢"+sql_v("¾ì½ê")+"¨¢"+sql_v("Ź̾")+"¨¢¡¦¡¦¡¦¡¦¨¢"+sql_v("ǯ·îID")+"¨¢"+sql_v("ǯ·îÆüID")+"¨"
if (cnt=0)|(cnt>3){
mes mesA+"¡ú"
} else {
mes mesA
}
sql_next
loop
sql_q "select * from B"
su=stat
pos 500,0
mes "¢£ B (¥Æ¡¼¥Ö¥ë : ¥³¥é¥à¿ô 5 : ¥ì¥³¡¼¥É¿ô Ìó2,000·ï)"
mes "¨®¨¬¨¬¨¸¨¬¨¬¨¸¨¬¨¬¨¸¨¬¨¬¨¬¨¬¨¬¨¸¨¬¨¬¨¬¨¬¨¬¨¬¨¯"
mes "¨ÈÎÇ䨢¸¶²Á¨¢Ã±²Á¨¢¡¡Ç¯·îID¡¡¨¢¡¡Ç¯·îÆüID¡¡¨"
mes "¨²¨¬¨¬¨»¨¬¨¬¨»¨¬¨¬¨»¨¬¨¬¨¬¨¬¨¬¨»¨¬¨¬¨¬¨¬¨¬¨¬¨´"
repeat su
mes "¨"+sql_i("ÈÎÇä")+"¨¢"+sql_i("¸¶²Á")+"¨¢"+sql_i("ñ²Á")+"¨¢"+sql_v("ǯ·îID")+"¨¢"+sql_v("ǯ·îÆüID")+"¨"
sql_next
loop
sql_q "select * from C"
su=stat
pos 500,150
mes "¢£ C (¥Æ¡¼¥Ö¥ë : ¥³¥é¥à¿ô Ìó30 : ¥ì¥³¡¼¥É¿ô Ìó3Ëü·ï)"
mes "¨®¨¬¨¬¨¸¨¬¨¬¨¸¨¬¨¬¨¸¨¬¨¬¨¬¨¬¨¸¨¬¨¬¨¬¨¬¨¬¨¯"
mes "¨Çä¾å¨¢¿Í°÷¨¢µëÍ¿¨¢¡¦¡¦¡¦¡¦¨¢¡¡Ç¯·îID¡¡¨"
mes "¨²¨¬¨¬¨»¨¬¨¬¨»¨¬¨¬¨»¨¬¨¬¨¬¨¬¨»¨¬¨¬¨¬¨¬¨¬¨´"
repeat su
mes "¨"+sql_i("Çä¾å")+"¨¢¡¡"+sql_i("¿Í°÷")+"¨¢"+sql_i("µëÍ¿")+"¨¢¡¦¡¦¡¦¡¦¨¢"+sql_v("ǯ·îID")+"¨"
sql_next
loop
SELECT="select count(*)"
SELECT+=" from A inner join B"
SELECT+=" on A.ǯ·îÆüID = B.ǯ·îÆüID"
/////////////
sql_q SELECT
/////////////
su=stat
pos 10,220
mes "¡¦¥Æ¡¼¥Ö¥ëA.B¤ò·ë¹ç¤·¤Æ²¼µ¤Î¤è¤¦¤Ê·ë²Ì¤ò½Ð¤·¤¿¤¤¤Î¤Ç¤¹¤¬\n"
mes "¥ì¥³¡¼¥É¿ô = "+sql_i("count(*)")
SELECT="select A.ǯ·îÆüID, A.Ź̾, B.ÈÎÇä"
SELECT+=" from A inner join B"
SELECT+=" on A.ǯ·îÆüID = B.ǯ·îÆüID"
;SELECT+=" where A.ÃÏ°è = '´ØÅì' and B.¸¶²Á > 1000"
/////////////
sql_q SELECT
/////////////
su=stat
mes "ǯ·îÆüID¡¡¡¡;Ź̾;ÈÎÇä "
repeat su
mes sql_v("ǯ·îÆüID")+";"+sql_v("Ź̾")+";"+sql_i("ÈÎÇä")
sql_next
loop
/*
¥Æ¡¼¥Ö¥ëA¤Î[ǯ·îID]¤Ï½ÅÊ£¤¬¤¢¤ê¤Þ¤¹¤¬,¥Æ¡¼¥Ö¥ëB¤ÏñÆȤǤ¹¡£
¥Æ¡¼¥Ö¥ëA.B¤Î[ǯ·îÆüID]¤ÏñÆȤǤ¹¡£
¥Æ¡¼¥Ö¥ëC¤Î[ǯ·îID]¤ÏñÆȤǤ¹¤¬[ǯ·îÆüID]¤Ïͤê¤Þ¤»¤ó
¤ä¤ê¤¿¤¤»ö
¡ ¥Æ¡¼¥Ö¥ëA.B¤ò·ë¹ç¤·¤Æ¤½¤ì¤¾¤ì¤Î¥³¥é¥à¤ÎÃͤòÃê½Ð¤·¤¿¤¤¡£
¢ ¡¤Ç½Ð¤¿[ǯ·îID]¤«¤é¥Æ¡¼¥Ö¥ëC¤Î¥³¥é¥à¤ÎÃͤòÃê½Ð¤·¤¿¤¤¡£
£ »î¤·¤¿sqlʸ¤ò1¤Ä¤ÎÅ»¤á¤¿¤¤¡£
¼ÂºÝ¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ç»î¤·¤¿»ö
¤Þ¤º [ inner join ] ¤Ç¤Ï¥Ý¥¤¥ó¥¿¡¼¤ÎÀè¤Ë¥°¥ë¥°¥ë¥Þ¡¼¥¯¤¬½Ð¤Æ¤¦¤Þ¤¯¹Ô¤¤Þ¤»¤ó¤Ç¤·¤¿¡£
[ outer left join ] , [ inner join ] , [ INTERSECT ] Åù¤âƱÍͤǤ·¤¿¡£
Í£°ì¡¢[ UNION All ]¤Ç²¿¤È¤«¤Ê¤ê¤½¤¦¤Ê¤Î¤Ç¡£
*/
mes "\n===[ UNION All ] ¤Î½àÈ÷===\n"
mes "¡-Subquery count---------"
//// Subquery count
SELECT="SELECT count(ǯ·îÆüID) FROM B"
SELECT+=" WHERE ǯ·îÆüID IN "
SELECT+=" (SELECT ǯ·îÆüID FROM A)"
////////////
sql_q SELECT
////////////
mes "B ¤«¤é ¥ì¥³¡¼¥É¿ô = "+sql_i("count(ǯ·îÆüID)")
count_A=sql_i("count(ǯ·îÆüID)")
mes "\n---Subquery Ź̾---------"
//// Subquery Ź̾
SELECT="SELECT ǯ·îÆüID, Ź̾ FROM A"
SELECT+=" WHERE ǯ·îÆüID IN "
SELECT+=" (SELECT ǯ·îÆüID FROM B)"
////////////
sql_q SELECT
////////////
su=stat
mes "A ¤«¤é Ź̾"
repeat su
mes sql_v("ǯ·îÆüID")+" : "+sql_v("Ź̾")
sql_next
loop
mes "\n-----Subquery ÈÎÇä-------"
//// Subquery ÈÎÇä
SELECT="SELECT ǯ·îÆüID, ÈÎÇä FROM B"
SELECT+=" WHERE ǯ·îÆüID IN "
SELECT+=" (SELECT ǯ·îÆüID FROM A)"
////////////
sql_q SELECT
////////////
su=stat
mes "B ¤«¤é ÈÎÇä"
repeat su
mes sql_v("ǯ·îÆüID")+" : "+sql_i("ÈÎÇä")
sql_next
loop
pos 300,365
mes ";---[ UNION All ]-----------"
SELECT=" SELECT ǯ·îÆüID, Ź̾ FROM A"
SELECT+=" WHERE ǯ·îÆüID IN "
SELECT+=" (SELECT ǯ·îÆüID FROM B)"
SELECT+=" UNION All "
SELECT+=" SELECT ǯ·îÆüID, ÈÎÇä FROM B"
SELECT+=" WHERE ǯ·îÆüID IN "
SELECT+=" (SELECT ǯ·îÆüID FROM A)"
////////////
sql_q SELECT
////////////
su=stat
mes "A¤ÈB¤«¤é ǯ·îÆüID,Ź̾,ÈÎÇä¤ò[ UNION All ]¤Ç"
mes "ǯ·îÆüID¡¡¡¡;Ź̾"
repeat su
mes sql_v("ǯ·îÆüID")+";"+sql_v("Ź̾")
sql_next
loop
//// Subquery Ź̾ group_concat(Ź̾)
SELECT="SELECT ǯ·îÆüID, group_concat(Ź̾) FROM"
SELECT+=" ("
SELECT+=" SELECT ǯ·îÆüID, Ź̾ FROM A"
SELECT+=" WHERE ǯ·îÆüID IN "
SELECT+=" (SELECT ǯ·îÆüID FROM B)"
SELECT+=" UNION All "
SELECT+=" SELECT ǯ·îÆüID, ÈÎÇä FROM B"
SELECT+=" WHERE ǯ·îÆüID IN "
SELECT+=" (SELECT ǯ·îÆüID FROM A)"
SELECT+=" )"
SELECT+=" group by ǯ·îÆüID"
;pos 800,300
////////////
sql_q SELECT
////////////
su=stat
mes "\n¢-[ UNION All ]-----------"
mes "ÈÎÇ䤬Ź̾¤Î½ê¤ËÍè¤Æ¤¤¤ë¤Î¤Çgroup_concat(Ź̾)¤Ç"
i=0
mes "ǯ·îÆüID¡¡¡¡;Ź̾;ÈÎÇä"
repeat su
split sql_v("group_concat(Ź̾)"),",",a
if stat=2{
i+
mes sql_v("ǯ·îÆüID")+","+sql_v("group_concat(Ź̾)")
}
if i=count_A:break
sql_next
loop
pos 750,365
mes "£-Subquery count---------"
mes "¾ò·ï¤Ç¹Ê¤ê¤Þ¤¹"
SELECT="SELECT count(ǯ·îÆüID) FROM B"
SELECT+=" WHERE ñ²Á > 3000 and ǯ·îÆüID IN "
SELECT+=" (SELECT ǯ·îÆüID FROM A
SELECT+=" where ÃÏ°è = '´ØÅì')"
////////////
sql_q SELECT
////////////
mes "B ¤«¤é ¥ì¥³¡¼¥É¿ô = "+sql_i("count(ǯ·îÆüID)")
count_A=sql_i("count(ǯ·îÆüID)")
mes "\n¤-[ UNION All ]-----------"
SELECT="SELECT ǯ·îÆüID, group_concat(Ź̾), group_concat(ÃÏ°è) FROM"
SELECT+=" ("
SELECT+=" SELECT ǯ·îÆüID, Ź̾, ÃÏ°è FROM A"
SELECT+=" WHERE ǯ·îÆüID IN "
SELECT+=" (SELECT ǯ·îÆüID FROM B where ñ²Á > 3000)"
SELECT+=" UNION All "
SELECT+=" SELECT ǯ·îÆüID, ÈÎÇä, ñ²Á FROM B"
SELECT+=" WHERE ǯ·îÆüID IN "
SELECT+=" (SELECT ǯ·îÆüID FROM A where ÃÏ°è = '´ØÅì')"
SELECT+=" )"
SELECT+=" group by ǯ·îÆüID"
;pos 800,300
////////////
sql_q SELECT
////////////
su=stat
i=0
mes "ǯ·îÆüID¡¡¡¡;Ź̾;ÈÎÇä;ÃÏ°è;ñ²Á"
repeat su
split sql_v("group_concat(Ź̾)"),",",a
if stat=2{
i+
mes sql_v("ǯ·îÆüID")+","+sql_v("group_concat(Ź̾)")+","+sql_v("group_concat(ÃÏ°è)")
}
if i=count_A:break
sql_next
loop
// DB¥¯¥í¡¼¥º //
sql_close
stop
/*
¼ÂºÝ¤Îsqlʸ¤Ç¤Ï¡¤È¢¤Ç½ÐÍè¤Þ¤·¤¿¤¬
join·Ï¤¬»È¤¨¤Ê¤¤¤Î¤¬Á´¤¯¤Î¸í»»¤Ç¡¢¥Æ¡¼¥Ö¥ëC¤Ë¹Ô¤¯Á°¤ËÎÏ¿Ô¤¤Æ¤·¤Þ¤¤¤Þ¤·¤¿¡£
sqlʸ¤ò°ì¤Ä¤ËÅ»¤á¤Æ¹¹¤Ë¥Æ¡¼¥Ö¥ëC¤«¤é¥³¥é¥à¤ÎÃͤòÃê½Ð¤¹¤ë»ö¤Ï²Äǽ¤Ç¤·¤ç¤¦¤«¡©
¤è¤í¤·¤¯¤ª´ê¤¤¤¤¤¿¤·¤Þ¤¹¡£(£¡¢¤¤Ï¾ò·ï¤ò»î¤·¤Æ¤ß¤Þ¤·¤¿¡£)
*/

| |
|
2019/9/5(Thu) 22:11:38|NO.88333
inner join¤¬½ÐÍè¤Ê¤¤¤È¤«UNION ALL¤Ç¹Ô¤¦¤È¤«PGÆâ¤ËµºÜ¤·¤Æ¤ë¤Î¤Ç
¼ÁÌ䤬¤ï¤«¤ê¤Å¤é¤¤¤Ç¤¹¤¬SQL¤Î½ñ¤Êý¤ÎÏäǤ¹¤è¤Í¡©
°Ê²¼¤Ç¤É¤¦¤Ç¤¹¤«¡£
°ã¤Ã¤Æ¤¤¤¿¤é¶µ¤¨¤Æ¤¯¤À¤µ¤¤¡£
;¢£¥¦¥£¥ó¥É¥¦½é´üÀßÄê
screen 0,1200,700,0,0,0
#include "sqlele.hsp"
// DB¥ª¡¼¥×¥ó //
sql_open ":memory:"
;¢£ A (¥Æ¡¼¥Ö¥ë : ¥³¥é¥à¿ô Ìó30 : ¥ì¥³¡¼¥É¿ô Ìó30Ëü·ï)
sql_q "create table A(ÃÏ°è, ¾ì½ê, Ź̾, ǯ·îID, ǯ·îÆüID)"
sql_q "insert into A values('´ØÅì', 'Åìµþ', 'ËãÉÛ', 'Åìµþ201001', 'Åìµþ20100101')"
sql_q "insert into A values('´ØÅì', 'ºë¶Ì', 'ÂçµÜ', 'ºë¶Ì201001', 'ºë¶Ì20100102')"
sql_q "insert into A values('´ØÀ¾', 'Âçºå', 'ÇßÅÄ', 'Âçºå201001', 'Âçºå20100103')"
sql_q "insert into A values('´ØÅì', 'Åìµþ', 'ËãÉÛ', 'Åìµþ201907', 'Åìµþ20190705')"
sql_q "insert into A values('´ØÅì', 'ºë¶Ì', 'ÂçµÜ', 'ºë¶Ì201908', 'ºë¶Ì20190805')"
sql_q "insert into A values('´ØÀ¾', 'Âçºå', 'ÇßÅÄ', 'Âçºå201909', 'Âçºå20190905')"
;¢£ B (¥Æ¡¼¥Ö¥ë : ¥³¥é¥à¿ô 5 : ¥ì¥³¡¼¥É¿ô Ìó2,000·ï)
sql_q "create table B(ÈÎÇä integer, ¸¶²Á integer, ñ²Á integer, ǯ·îID, ǯ·îÆüID)"
sql_q "insert into B values(2000, 1000, 3000, 'Åìµþ201001', 'Åìµþ20100101')"
sql_q "insert into B values(2500, 1100, 3100, 'ºë¶Ì201908', 'ºë¶Ì20190805')"
sql_q "insert into B values(3000, 1200, 3200, 'Âçºå201909', 'Âçºå20190905')"
;¢£ C (¥Æ¡¼¥Ö¥ë : ¥³¥é¥à¿ô Ìó30 : ¥ì¥³¡¼¥É¿ô Ìó30,000·ï)
sql_q "create table C(Çä¾å integer, ¿Í°÷ integer, µëÍ¿ integer, ǯ·îID)"
sql_q "insert into C values(6000, 13, 2600, 'Åìµþ201001')"
sql_q "insert into C values(7750, 10, 2100, 'ºë¶Ì201908')"
sql_q "insert into C values(9600, 15, 3200, 'Âçºå201909')"
sql_q "select * from A"
su=stat
mes "¢£ A (¥Æ¡¼¥Ö¥ë : ¥³¥é¥à¿ô Ìó30 : ¥ì¥³¡¼¥É¿ô Ìó30Ëü·ï)"
mes "¨®¨¬¨¬¨¸¨¬¨¬¨¸¨¬¨¬¨¸¨¬¨¬¨¬¨¬¨¸¨¬¨¬¨¬¨¬¨¬¨¸¨¬¨¬¨¬¨¬¨¬¨¬¨¯"
mes "¨Ãϰ訢¾ì½ê¨¢Å¹Ì¾¨¢¡¦¡¦¡¦¡¦¨¢¡¡Ç¯·îID¡¡¨¢¡¡Ç¯·îÆüID¡¡¨"
mes "¨²¨¬¨¬¨»¨¬¨¬¨»¨¬¨¬¨»¨¬¨¬¨¬¨¬¨»¨¬¨¬¨¬¨¬¨¬¨»¨¬¨¬¨¬¨¬¨¬¨¬¨´"
repeat su
mesA = "¨"+sql_v("ÃÏ°è")+"¨¢"+sql_v("¾ì½ê")+"¨¢"+sql_v("Ź̾")+"¨¢¡¦¡¦¡¦¡¦¨¢"+sql_v("ǯ·îID")+"¨¢"+sql_v("ǯ·îÆüID")+"¨"
if (cnt=0)|(cnt>3){
mes mesA+"¡ú"
} else {
mes mesA
}
sql_next
loop
sql_q "select * from B"
su=stat
pos 500,0
mes "¢£ B (¥Æ¡¼¥Ö¥ë : ¥³¥é¥à¿ô 5 : ¥ì¥³¡¼¥É¿ô Ìó2,000·ï)"
mes "¨®¨¬¨¬¨¸¨¬¨¬¨¸¨¬¨¬¨¸¨¬¨¬¨¬¨¬¨¬¨¸¨¬¨¬¨¬¨¬¨¬¨¬¨¯"
mes "¨ÈÎÇ䨢¸¶²Á¨¢Ã±²Á¨¢¡¡Ç¯·îID¡¡¨¢¡¡Ç¯·îÆüID¡¡¨"
mes "¨²¨¬¨¬¨»¨¬¨¬¨»¨¬¨¬¨»¨¬¨¬¨¬¨¬¨¬¨»¨¬¨¬¨¬¨¬¨¬¨¬¨´"
repeat su
mes "¨"+sql_i("ÈÎÇä")+"¨¢"+sql_i("¸¶²Á")+"¨¢"+sql_i("ñ²Á")+"¨¢"+sql_v("ǯ·îID")+"¨¢"+sql_v("ǯ·îÆüID")+"¨"
sql_next
loop
sql_q "select * from C"
su=stat
pos 500,150
mes "¢£ C (¥Æ¡¼¥Ö¥ë : ¥³¥é¥à¿ô Ìó30 : ¥ì¥³¡¼¥É¿ô Ìó3Ëü·ï)"
mes "¨®¨¬¨¬¨¸¨¬¨¬¨¸¨¬¨¬¨¸¨¬¨¬¨¬¨¬¨¸¨¬¨¬¨¬¨¬¨¬¨¯"
mes "¨Çä¾å¨¢¿Í°÷¨¢µëÍ¿¨¢¡¦¡¦¡¦¡¦¨¢¡¡Ç¯·îID¡¡¨"
mes "¨²¨¬¨¬¨»¨¬¨¬¨»¨¬¨¬¨»¨¬¨¬¨¬¨¬¨»¨¬¨¬¨¬¨¬¨¬¨´"
repeat su
mes "¨"+sql_i("Çä¾å")+"¨¢¡¡"+sql_i("¿Í°÷")+"¨¢"+sql_i("µëÍ¿")+"¨¢¡¦¡¦¡¦¡¦¨¢"+sql_v("ǯ·îID")+"¨"
sql_next
loop
; ¡ú¡¡°Ê²¼¤òÄɲÃ
;-----------------------------------------------------------------------------------
pos 0
mes "\n¡ú¡ ¥Æ¡¼¥Ö¥ëA.B¤ò·ë¹ç¤·¤Æ¤½¤ì¤¾¤ì¤Î¥³¥é¥à¤ÎÃͤòÃê½Ð¤·¤¿¤¤¡£¡ú"
sql={"
select * from A, B
where A.ǯ·îÆüID = B.ǯ·îÆüID
"}
sql_q sql: su = stat
repeat su
mes strf( "¡¡Ç¯·îÆüID[%s]Ź̾[%s]ÈÎÇä[%s]", sql_v("ǯ·îÆüID"), sql_v("Ź̾"), sql_v("ÈÎÇä") )
sql_next
loop
;-----------------------------------------------------------------------------------
pos 0
mes "\n¡ú¢ ¡¤Ç½Ð¤¿[ǯ·îID]¤«¤é¥Æ¡¼¥Ö¥ëC¤Î¥³¥é¥à¤ÎÃͤòÃê½Ð¤·¤¿¤¤¡£¡ú"
sql={"
select * from C
where
c.ǯ·îID in ( select A.ǯ·îID from A, B where A.ǯ·îÆüID = B.ǯ·îÆüID )
"}
sql_q sql: su = stat
repeat su
mes strf( "¡¡Çä¾å[%s]¿Í°÷[%s]µëÍ¿[%s]ǯ·îID[%s]", sql_v("Çä¾å"), sql_v("¿Í°÷"), sql_v("µëÍ¿"), sql_v("ǯ·îID") )
sql_next
loop
stop

| |
|
2019/9/6(Fri) 15:52:41|NO.88336
>¤µ¤«¤µ¤ó
¤´²óÅú¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£
¤Þ¤¿¡¢¼ÁÌä¤ÎËܼÁ¤¬²ò¤ê¤Å¤é¤¯¤Æ¿½¤·Ìõ¤´¤¶¤¤¤Þ¤»¤ó¤Ç¤·¤¿¡£
¼ÂºÝHSP¤Î¼ÁÌäÈĤʤΤËSQL¤Î¼ÁÌä¤ò¤·¤¿¤Î¤¬´Ö°ã¤Ã¤Æ¤¤¤¿¤Î¤«¤â¤·¤ì¤Þ¤»¤ó¤¬¤´ÍƼϲ¼¤µ¤¤¡£
°ìÈ֤ˤªÊ¹¤¤·¤¿¤«¤Ã¤¿¤Î¤Ï¡¢
¥ì¥³¡¼¥É¿ô¤¬¤½¤ì¤¾¤ì[ 30Ëü·ï¤È2Àé·ï,3Ëü·ï¤Î¥Æ¡¼¥Ö¥ë¤ò·ë¹ç ]¤·¤ÆÃͤòÃê½Ð½ÐÍè¤ë¤Î¤«¡¢
ÆäËjoin·Ï¤Ç²Äǽ¤Ê¤Î¤«¡¢½ÐÍè¤Ê¤¤¾ì¹ç¤Ïº£²óÄ󼨤·¤¿union all¤Î¾¤Ë
²¿¤«¤â¤Ã¤È´Êñ¤ÊÊýË¡¤¬¤¢¤ë¤Î¤Ç¤·¤ç¤¦¤«¡©¤È¸À¤¦»ö¤Ç¤¹¡£
¤´Ä󼨤¤¤¿¤À¤¤¤¿¥¹¥¯¥ê¥×¥È
select * from A, B
where A.ǯ·îÆüID = B.ǯ·îÆüID
¤Ç¤¹¤¬¡¢
select * ¤ÏÀäÂÐ̵Íý(buffer over flow)¤Ç¤¹¤Î¤Ç
count¤ò¼èÆÀ¤·¤Æ¤«¤é¼¡¤Îsqlʸ¤Çlimit¤ò¤«¤±¤Ê¤±¤ì¤ÐÃͤòÃê½Ð¤¹¤ë»ö¤¬½ÐÍè¤Þ¤»¤ó¡£
from A, B ¤â¥Æ¡¼¥Ö¥ë2¤Ä¤«¤é¤Ï̵Íý(¥Ý¥¤¥ó¥¿¡¼¤ÎÀè¤Ë¥°¥ë¥°¥ë¥Þ¡¼¥¯¤¬½Ð¤Æ±þÅú¤Ê¤·)¤Ç¤¹¡£
¤È¸À¤¦Ìõ¤Ç
where A.ǯ·îÆüID = B.ǯ·îÆüID ¤â»È¤¦»ö¤¬½ÐÍè¤Þ¤»¤ó¡£
join·Ï¤âƱÍͤǤ¢¤ëÄøÅ٤Υ쥳¡¼¥É¿ô¤òĶ¤¨¤ë¤È»È¤¨¤Ê¤¤¤è¤¦¤Ç¤¹¡£
Í£°ì²¿¤È¤«¤Ê¤Ã¤¿¤Î¤¬ IN¶ç¤ò»È¤Ã¤¿¾ì¹ç¤Ç¤¹¤¬
¤ä¤Ï¤êSELECT ¡Á FROM A, B¤È¥Æ¡¼¥Ö¥ë¤ò·Ò¤²¤ë¤È¥°¥ë¥°¥ë¥Þ¡¼¥¯¤¬½Ð¤Æ±þÅú¤Ê¤·¤Ë¤Ê¤ê¤Þ¤¹¡£
¤½¤³¤Çunion all¤ò»È¤Ã¤Æ¤ß¤¿¤Î¤Ç¤¹¤¬¡¦¡¦¡¦¡£
sql={"
select * from C
where
c.ǯ·îID in ( select A.ǯ·îID from A, B where A.ǯ·îÆüID = B.ǯ·îÆüID )
"}
¤â¶²¤é¤¯»È¤¨¤Ê¤¤¤È»×¤¤¤Þ¤¹(¸¡¾Ú¤â¤»¤º¤Ë¥´¥á¥ó¥Ê¥µ¥¤)¡£
¤Ç¤â¡¢C¤ÎÃͤòÃê½Ð¤¹¤ëÊýË¡¤¬·Á¤È¤·¤ÆÌÀ³Î¤Ë¸«¤¨¤Æ¤¤Þ¤·¤¿¤Î¤Ç¤È¤Æ¤â¤¦¤ì¤·¤¯»×¤¤¤Þ¤¹¡£
¤â¤·¡¢Â¾¤Ë¥ì¥³¡¼¥É¿ô¤Î¿¤¤Ê£¿ô¤Î¥Æ¡¼¥Ö¥ë¤«¤éÃͤòÃê½Ð¤¹¤ëÊýË¡¤ò¤´Â¸¤¸¤Ç¤·¤¿¤é
À§Èó¤´Ä󼨤¤¤¿¤À¤±¤ì¤Ð¤È»×¤¤¤Þ¤¹¡£É¬¤º¸¡¾Ú¤µ¤»¤Æ¤¤¤¿¤À¤¤Þ¤¹¤Î¤Ç¡£
µ®½Å¤Ê¤ª»þ´Ö¤ò³ä¤¤¤Æ¤´²óÅú¤¤¤¿¤À¤ËÜÅö¤Ë¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£

| |
|
2019/9/6(Fri) 22:53:59|NO.88339
¤Ê¤ë¤Û¤É¡¢·ï¿ô¤¬Â¿¤¯¡Öbuffer over flow¡×¤È¤Ê¤ë¤Î¤Çjoin¤¬½ÐÍè¤Ê¤¤¤È¸À¤¦¤³¤È¤Ç¤¹¤«¡£
¤½¤·¤¿¤é¤Þ¤º³Æ¥Æ¡¼¥Ö¥ë¤Ë¥×¥é¥¤¥Þ¥ê¡¼¥¡¼¤òÀßÄꤷ¤¿¤é¤É¤¦¤Ç¤¹¤«¡©
ǯ·îÆüID¤Èǯ·îID¤Ç¤¹¤Í¡£¤³¤ì¤Ç²ò·è¤·¤Ê¤¤¤Ç¤¹¤«¡©
¤Þ¤¿¡Öbuffer over flow¡×¤Ê¤Î¤Çmemory¤Ç¤Ï¤Ê¤¯¥Õ¥¡¥¤¥ë¤Ç£Ä£ÂºîÀ®¤¹¤ì¤Ð°ã¤¦¤«¤âÃΤì¤Ê
¤¤¤Ç¤¹¤è¡£
¤½¤ì¤Ç¤â¥À¥á¤Ê¤éÃÙ¤¤¤È»×¤¤¤Þ¤¹¤¬£±¤Ä¤Î£Ó£Ñ£Ì¤È¤·¤Ê¤¤¤Ç£±¥Æ¡¼¥Ö¥ë¤Å¤ÄÆɤó¤Ç¥ë¡¼¥×¤µ
¤»¤Æ¤½¤ÎÃæ¤Ç¤Þ¤¿¥Æ¡¼¥Ö¥ë¤òÆɤá¤Ð¸Ç¤Þ¤é¤Ê¤¤¤ó¤¸¤ã¤Ê¤¤¤Ç¤·¤ç¤¦¤«¡£
¤½¤ì¤«¤â¤¦SQLite¤Ï¤ä¤á¤Æ̵½þ¤ÎORACLE¤äSQLSEVER¤ò»È¤Ã¤ÆODBC¤Ç¤ä¤ì¤Ð¿ô½½Ëü·ï¤¯¤é¤¤¤Î
·ï¿ô¤Ê¤é®¤¤¤È»×¤¤¤Þ¤¹¡£
¿ÊŸ¤·¤¿¤é¤Þ¤¿¶µ¤¨¤Æ¤¯¤À¤µ¤¤¡£
|
|
2019/9/6(Fri) 23:13:36|NO.88340
¤È²óÅú¤¬°Â°×¤À¤Ã¤¿¤«¤â¤È»×¤¤¤Þ¤·¤¿¡£(^^;
¡Öbuffer over flow¡×¤Î¸¶°ø¤¬²¿¤Ê¤Î¤«¤Ç¤¹¤Í¡£
¥Ç¡¼¥¿¿ô¤¬Â¿¤¯¤Æ¤Î¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤À¤È¥×¥é¥¤¥Þ¥ê¡¼¥¡¼¤ÎÏ两ã¤Ê¤¤¤Ç¤¹¤Í¡£
¤³¤Î¾ì¹ç¤À¤È¤¹¤ì¤Ð¡¢£±²ó¤ÎSQL¤Ç¤Î¼Â¹Ô·ï¿ô¤ò¸º¤é¤¹É¬Íפ¬¤¢¤ë¤Î¤Ç¥ë¡¼¥×¤·¤ÆÇÛÎó
¤ËÆþ¤ì¤Æ¤¤¤¯¤Î¤¬¤¤¤¤¤Ç¤¹¤«¤Í¡£
¤¿¤À30Ëü¤¯¤é¤¤¤Ê¤é¹Ô¤±¤½¤¦¤Êµ¤¤¬¤·¤Þ¤¹¤¬¡£PC¤ÎÅëºÜ¥á¥â¥ê¤¬¾¯¤Ê¤¤¤È¤«¤Ç¤¹¤«¡©
UNION¤ò»ÈÍѤ¹¤ë¤Î¤Ï²ò·è¤Ë¤Ê¤é¤Ê¤¤¤è¤¦¤Êµ¤¤¬¤·¤Þ¤¹¤¬¡£¡£
|
|
2019/9/7(Sat) 00:25:18|NO.88342
¥×¥é¥¤¥Þ¥ê¡¼¥¡¼¤È¤¤¤¦¸ÀÍÕ¼«ÂΤϤʤó¤È¤Ê¤¯ÃΤäƤ¤¤¿¤È»×¤¤¤Þ¤¹¤¬
¥¹¥ë¡¼¤·¤Æ¤¤¤¿¤Î¤Ç°ÕÌ£¤ÏÁ´¤¯Ê¬¤«¤ê¤Þ¤»¤ó¤Ç¤·¤¿¡£
»ä¤¬»²¹Í¤Ë¤·¤Æ¤¤¤ë¥µ¥¤¥È¤Ë¤â¤ä¤Ï¤ê¥×¥é¥¤¥Þ¥ê¡¼¥¡¼¤ÏºÜ¤Ã¤Æ¤¤¤Þ¤·¤¿¤¬
¡Ö¹â®¤Ë¥Æ¡¼¥Ö¥ë¥Ç¡¼¥¿¤Î¸¡º÷¤¬¼Â¹Ô¤Ç¤¤¿¤ê¡¢À°¹çÀ¤Î¼è¤ì¤¿¥Ç¡¼¥¿¤òºîÀ®¤¹¤ë¤³¤È¤¬²Äǽ¡×
¤È¤¤¤¦¤³¤È¤Ïº£Â¾¤Î¥µ¥¤¥È¤ò¸¡º÷¤·¤Æ¤ß¤Æ½é¤á¤ÆÃΤê¤Þ¤·¤¿¡£
¤â¤·¤«¤·¤¿¤é»È¤¨¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¤Î¤ÇÀ§È󸡾ڤ·¤Æ¤ß¤¿¤¤¤È»×¤¤¤Þ¤¹¡£
¤¿¤À¡¢
>¥Ç¡¼¥¿¿ô¤¬Â¿¤¯¤Æ¤Î¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤À¤È¥×¥é¥¤¥Þ¥ê¡¼¥¡¼¤ÎÏ两ã¤Ê¤¤¤Ç¤¹¤Í
¤È¸À¤¦¤Î¤¬µ¤¤Ë¤Ê¤ê¤Þ¤¹¤¬¡¦¡¦¡¦¡£
>SQLite¤Ï¤ä¤á¤Æ̵½þ¤ÎORACLE¤äSQLSEVER¤ò»È¤Ã¤ÆODBC¤Ç¤ä¤ì¤Ð¿ô½½Ëü·ï¤¯¤é¤¤¤Î·ï¿ô¤Ê¤é®¤¤¤È»×¤¤¤Þ¤¹
¤³¤ì¤Ï¥À¥á¡£HSP¤ÇÆ°ºî¤¹¤ë¤Î¤ÏSQLite¤Ê¤Î¤Ç¡£
»ä¤ÏHSP¤¬Âç¹¥¤¤Ç¡¢¤È¤¤¤¦¤«HSP¤·¤«½ÐÍè¤Ê¤¤¤Î¤Ç¤³¤³¤Ç»È¤¨¤ëSQLite¤Ç²¿¤È¤«¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤ó¤Ç¤¹¡£
2ǯÁ°¤¯¤é¤¤¤ËHSP¤Ç¥Ç¡¼¥¿¥Ù¡¼¥¹¤¬»È¤¨¤ë¤Î¤ò½é¤á¤ÆÃΤäơ¢
º£¤Ç¤Ï¥ï¥ó¥Æ¡¼¥Ö¥ë¤Ç¤¹¤¬30Ëü·ï¤Û¤É¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤¬°·¤¨¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤·¤¿¡£
¤½¤ì¤Þ¤Ç¤Ïtext¤«¤éÊÑ¿ô¤ËÆþ¤ì¤Æ¾ðÊó¤òÆÀ¤ë¤Î¤Ë10Éö᤯ÂÔ¤¿¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤«¤Ã¤¿¤Î¤Ç³ÊÃʤΰ㤤¤Ç¤¹¡£
¤Á¤ç¤Ã¤ÈÏ䬤º¤ì¤Æ¤·¤Þ¤Ã¤¿¤Î¤Ç¸µ¤ËÌᤷ¤Þ¤¹¤Í¡£
°ø¤ß¤Ë
¥á¥â¥ê¤Ï16GB (8GB¡ß2) DDR4-2400MHz¤Ç¥¤¥ó¥Æ¥ëR Core i7-8550U(8th Gen)¤Ç¤¹¡£
¥Ñ¥½¥³¥ó¤ÎÀǽ¤Î¤³¤È¤â¤è¤¯¤ï¤«¤ê¤Þ¤»¤ó¤¬¡¢¾¯¤Ê¤¤²á¤®¤ë¤Î¤Ç¤·¤ç¤¦¤«¡£
º£Æü¤Ï¤â¤¦Ì²¤¤¤Î¤Ç¡¢ÌÀÆü¥×¥é¥¤¥Þ¥ê¡¼¥¡¼¤Ç¤¼¤Ò¸¡¾Ú¤·¤Æ¤ß¤¿¤¤¤È»×¤¤¤Þ¤¹¡£
¾¤Ë¤â¤¤¤í¤¤¤í¤´Äó°Æ¤¤¤¿¤À¤ËÜÅö¤Ë¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£¡¡´èÄ¥¤ê¤Þ¤¹¡ª

| |
|
2019/9/7(Sat) 11:07:35|NO.88346
¼«Ê¬¤ÏSQLite¤Ç270Ëü·ï¤Î¥Æ¡¼¥Ö¥ë¥Ç¡¼¥¿¤¢¤ë¤Î¤Ç¤Á¤ç¤Ã¤ÈHSP¤Ç»î¤·¤Æ¤ß¤Þ¤·¤¿¡£
¾ò·ï¤Ëlimit¤Î·ï¿ôÀ©¸Â¤Ä¤±¤Æ¤Îselect¤Ç¤¹¡£
limit 10000¤Ç10É䯤餤¡£
limit 100000¤Ç¿ô½½Ê¬¤Ç¤â½èÍý¤¬½ª¤ï¤ê¤Þ¤»¤ó¤Í(^^;
DB¥Ä¡¼¥ë(A5:SQL)¤À¤Èlimit¤Ä¤±¤Ê¤¯Á´·ï¤Ç¤â°ì½Ö¤Ç¥Ç¡¼¥¿É½¼¨¤µ¤ì¤Þ¤¹¡£
¼«Ê¬¤ÎPC¤Ï¾¯¤·¸Å¤¤¤Î¤Ç¤¹¤¬¤½¤ì¤Ç¤â¤³¤ì¤À¤±°ã¤¦¤Î¤Çhsp¤ÎÌäÂê¤Ý¤¤¤Ç¤¹¤Í¡£
PCÀǽ¤ä:memoryÆâ¤Ç¤Î¹½Ãۤǰ㤦¤È»×¤¤¤Þ¤¹¤¬¡¢¤Ä¤Þ¤ê¥Æ¡¼¥Ö¥ë´Ö¤Î·ë¹ç°ÊÁ°¤Ë
hsp¤Ç¤Î1²ó¤Îselect¤Î¼èÆÀ·ï¿ô¤¬ÌäÂê¤Ê¤Î¤«¤È»×¤¤¤Þ¤¹¡£
30Ëü·ï¤ÎA¥Æ¡¼¥Ö¥ë¤òÁ´·ïÆɤ߹þ¤à¤À¤±¤Ç¸Ç¤Þ¤ê¤Þ¤»¤ó¤«¡©
¤â¤·»þ´Ö¤¬¤«¤«¤Ã¤Æ¤â½èÍý¤¬½ª¤ï¤ì¤Ð¥×¥é¥¤¥Þ¥ê¤ä¥¤¥ó¥Ç¥Ã¥¯¥¹¤òŽ¤ì¤Ð½èÍý¤¬Â®¤¯
¤Ê¤ë¤Î¤Ç¤¤¤¤¤«¤âÃΤì¤Ê¤¤¤Ç¤¹¡£
¤â¤·¥À¥á¤Ê¤éǯ·î¤Ç¾ò·ï¤ò¤·¤Ü¤Ã¤ÆÃê½Ð·ï¿ô¤ò¾¯¤Ê¤¯¤¹¤ì¤Ð¤¤¤¤¤Î¤Ç¤Ï¤È»×¤¤¤Þ¤¹¡£
¼«Ê¬¤Ï270Ëü·ï¤òhsp¤Ç½èÍý¤·¤Æ¤Þ¤¹¤¬1ÅÙ¤ÎÃê½Ð·ï¿ô¤Ï¿ô·ï¤Ê¤Î¤ÇÌäÂê¤Ê¤¤¤Ç¤¹¡£
¤Á¤Ê¤ß¤ËSQLite°Ê³°¤ÎDB¤âHSP¤Ç°·¤¨¤Þ¤¹¤è¡£¤½¤ì¤¬ODBC¥É¥é¥¤¥Ð¤Ç¤¹¡£
¤Á¤ç¤Ã¤ÈDB¥¤¥ó¥¹¥È¡¼¥ë¤«¤éODBCÀßÄê¤È½àÈ÷¤¬Íפê¤Þ¤¹¤¬HSP¤À¤±¤ÎÏäǤÏ
¤Ê¤¤¤Î¤Ç¥Í¥Ã¥È¤Ç¤¤¤¯¤é¤Ç¤â½Ð¤Æ¤¯¤ë¤È»×¤¤¤Þ¤¹¡£
hsp¤Îsample\hspdb»²¾È¤·¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£
|
|
2019/9/7(Sat) 23:12:12|NO.88351
>¤µ¤«¤µ¤ó
¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡Á¡Á¡Á¡Á¡Á¡Á¡Á¡Á¡Á¡Á¡Á¡Á¡Á¡ª
¥×¥é¥¤¥Þ¥ê¡¼¥¡¼¤òÀßÄꤷ¤¿¤È¤³¤íºÇ½é¤Ë¤´Ä󼨤¤¤¿¤À¤¤¤¿
; ¡ú¡¡°Ê²¼¤òÄɲÃ
;-----------------------------------------------------------------------------------
pos 0
mes "\n¡ú¡ ¥Æ¡¼¥Ö¥ëA.B¤ò·ë¹ç¤·¤Æ¤½¤ì¤¾¤ì¤Î¥³¥é¥à¤ÎÃͤòÃê½Ð¤·¤¿¤¤¡£¡ú"
sql={"
select * from A, B
where A.ǯ·îÆüID = B.ǯ·îÆüID
"}
sql_q sql: su = stat
repeat su
mes strf( "¡¡Ç¯·îÆüID[%s]Ź̾[%s]ÈÎÇä[%s]", sql_v("ǯ·îÆüID"), sql_v("Ź̾"), sql_v("ÈÎÇä") )
sql_next
loop
´°àú¤Ëɽ¼¨¤µ¤ì¤Þ¤·¤¿¡£(Ìó2ÉäۤÉ)
¾ò·ï¤ò²Ã¤¨¤Æ¹Ê¤ê¹þ¤á¤Ð¤Û¤Ü½Ö»þ¤Ç¡Á¤¹¡°¡°
¤â¤¦¡¢¤¦¤ì¤·¤µ¤òÄ̤ê±Û¤·¤ÆȾ¥Ù¥½¾õÂ֤Ǥ·¤¿¡£
¼¡¤Ë¤´Ä󼨤¤¤¿¤À¤¤¤¿¥¹¥¯¥ê¥×¥È¤Ç£Ã¤ÎÃͤâ½Ð¤»¤½¤¦¤Ê¤Î¤Ç
¤³¤ì¤Ç£Ã¥Æ¡¼¥Ö¥ë¡¢£Ä¥Æ¡¼¥Ö¥ë¤ÈÍßÄ¥¤Ã¤ÆÁý¤ä¤»¤½¤¦¤Ç¤¹¡¢ËÜÅö¤Ë¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡£
Êä¤Ǥ¹¤¬
sql_q "select * from A"
¤Ç¤Ï¥¨¥é¡¼
NO debug module.
#error 26 in line 200(sqlele.hsp)
-->¥á¥â¥ê¤Î³ÎÊݤ¬¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿
--------------------------------------
sql_q "select count(*) from A"
sql_i("count(*)") = 531311
½Ö»þ¤Ç¤¹¡£
--------------------------------------
»ä¤Î£Ð£Ã´Ä¶¤Çlimit¤ò¤«¤±¤ë¤È
sql_q "select Á´Éô from A limit 5500"
sql_q "select 2¸Ä from A limit 22000"
sql_q "select 1¸Ä from A limit 31500"
¤Þ¤Ç¤Ïɽ¼¨¤µ¤ì¤Þ¤¹(Ìó2ÉäۤÉ)
--------------------------------------
¤ª¤è¤½2½µ´Ö¤¯¤é¤¤Çº¤ó¤Ç¤¤¤¿¤Î¤Ç¡¢ÊÖ¿®¤ò½ñ¤¤Ê¤¬¤é¤Ç¤Ï¤¢¤ê¤Þ¤¹¤±¤É
¤¹¤´¤¯¥Û¥Ã¤È¤·¤¿µ¤Ê¬¤ÇÎϤ¬È´¤±¤Æ¤¤¤¯´¶¤¸¤Ç¤¹¡£
¤½¤ì¤«¤é¡¢¤µ¤«¤µ¤ó¤â¤½¤¦¤Ç¤¹¤¬Â¾¤Î¥¹¥ì¤Ç¤´²óÅú¤µ¤ì¤Æ¤¤¤ë¾åµé¼Ô¤ÎÊý¡¹¤Î
¥¹¥¯¥ê¥×¥È¤Î½ñ¤Êý¤ä²ò·èÊýË¡¤Ï¤È¤Æ¤â»²¹Í¤Ë¤Ê¤ê¤Þ¤¹¡£
Æä˺£²ó¤Î
;-----------------------------------------------------------------------------------
pos 0
mes "\n¡ú¢ ¡¤Ç½Ð¤¿[ǯ·îID]¤«¤é¥Æ¡¼¥Ö¥ëC¤Î¥³¥é¥à¤ÎÃͤòÃê½Ð¤·¤¿¤¤¡£¡ú"
sql={"
select * from C
where
c.ǯ·îID in ( select A.ǯ·îID from A, B where A.ǯ·îÆüID = B.ǯ·îÆüID )
"}
sql_q sql: su = stat
repeat su
mes strf( "¡¡Çä¾å[%s]¿Í°÷[%s]µëÍ¿[%s]ǯ·îID[%s]", sql_v("Çä¾å"), sql_v("¿Í°÷"), sql_v("µëÍ¿"), sql_v("ǯ·îID") )
sql_next
loop
¤Ï¡¢¡Ö¤¨¤Ã¡©¤³¤ó¤Ê¤Ë´Êñ¤Ê»ö¤Ê¤Î¡©¡×¤È»×¤¦¤¯¤é¤¤´Ê·é¤Ê´¶¤¸¤Ç¤¹¤·
sql_q sql : su=stat
¤Ë»ê¤Ã¤Æ¤Ï¥¹¥Þ¡¼¥È¤Çʬ¤«¤ê¤ä¤¹¤¤¤Î¤Ç¤¼¤Ò»È¤ï¤»¤Æ¤¤¤¿¤À¤³¤¦¤È»×¤Ã¤Æ¤¤¤Þ¤¹¡°¡°
join·Ï¤Î»ö¤È¤«ODBC¤Î»ö¤â¤¢¤ê¤Þ¤¹¤¬¡¢¤³¤ì¤Ç°ì±þ²ò·è¤È¤µ¤»¤Æ¤¤¤¿¤À¤¤Þ¤¹¤Í¡£
¤Û¤ó¤È¡Á¤Ë¤¢¤ê¤¬¤È¤¦¤´¤¶¤¤¤Þ¤·¤¿¡ª

| |
|