Ö´ÐÐsql - PowerBuilder / Êý¾Ý¿âÏà¹Ø
update test set qty = qty - 1 where (location,sku,valid_date)
in (select location,sku,min(valid_date) from test
where location = 'chuwei' and item_code = '5678' group by location,sku)
ÒÔÉÏÓï¾äÔÚpbÖÐÓÃÏÂÁз½Ê½Ö´ÐРΪʲôµÚÒ»Ìõ¼Ç¼ûÓÐupdate
Execute Immediate :as_sql Using atran_ex
ÄãÊÇÏëÈÃÏàͬµÄlocation,skuÖУ¬×îСµÄvalid_dateÄÇÌõ¼Ç¼ÖÐqty-1?
ÒÔÏÂÁ½ÖÖ·½·¨¶¼ÐС£
update test
set qty = qty - 1
from test t where valid_date =
(select min(valid_date) from test where location = t.location and sku = t.sku)
update test
set qty = qty - 1
from test t where not exists
(select 1 from test where location = t.location and sku = t.sku and valid_date < t.valid_date)
update test set qty = qty - 1
where item_code = '5678'
and valid_date=(
select min(valid_date) from test a
where a.location= location and a.sku=sku )
)
Ïà¹ØÎÊ´ð£º
sqlµÄÈí¼þÔÚÄÄÀï¿ÉÒÔÏ°¡£¡ÔÚÍøÉÏÕÒÁËÂù¶à¶¼Óò»ÁË°¡
Ëæ±ã¸ãÒ»D°æ°É£¬
ѸÀ×µÚÒ»¸ö¾Í¿ÉÒÔÓÃ
2000,2005¶¼ÕâÑù
http://119.147.41.16/down?cid=0698C2D64D7D637D90A6D2482298E6717D4F15CD&t=2&fmt=-1 ......
select count(1) from FX_RETURNBOOKCHECKLIST fxreturnbo0_ where fxreturnbo0_.BOOKID='164 ' AND fxreturnbo0_.RETURNID='00025.S0000001'
ÉÏÃæÒ»¸ö¼òµ¥µÄSQL,Ö´ÐÐʱ¼ä2.6à ......
ÈçºÎÔÚSQL2005ÖÐÉ趨¶¨Ê±×÷Òµ£¬±ÈÈç˵¶¨Ê±ÇåÀíijЩ±íµÄÊý¾Ý£¬
»òÕßÊǶ¨Ê±µÄ½«Ä³Ð©±íµÄÊý¾Ýµ¼³öexcel£¡
ÔÚÏߵȴý£¬¼±¼±¼±£¬×îºÃÊÇÏêϸ²½Ö裡
֮ǰÎÒ×öµÄ×÷ÒµÓеãÎÊÌ⣡
°ïUP
²Î¿¼:http://hi.baidu.com/toiota ......
×Ö¶Î1,×Ö¶Î2.....×Ö¶ÎN,Status,ParentID
1,Name1....test1,1,99
1,Name1....test1,3,99
1,Name2....test2,1,101
1,Name2....test2,3,101
1,Name3....test3,2,101
1,Name1....test1,4,101
ÏëÒªµÄ½á¹ûÊÇ:
1,Na ......
Á½¸ö±í
Çë¿´ "Persons" ±í£º
name banji shunxu
yiyang 01 1
yiyang 02 1
lili 01 2
½ÓÏÂÀ´Çë¿´ "xueke" ±í£º
name kemu shunxu
yiy ......