ORACLE sqlÓï¾äµÄÎÊÌâ
ÏÖÔÚÓбíA£¨barcode varchar2£¬length number£©£¬B£¨barcode varchar2£¬serial number£©ÆäÖÐbarcode¹ØÁªA:BΪ1£ºn
ÓÐÈçÏÂsqlÓï¾ä
insert into a values('b1',10)
insert into a values('b2',20)
insert into a values('b3',30)
insert into b values('b1',1)
insert into b values('b2',2)
insert into b values('b2',3)
insert into b values('b3',4)
insert into b values('b4',5)
insert into b values('b4',6)
ÔÚÖ´ÐÐsql
select a.barcode,a.length,b.serial from a,b where a.barcode=b.barcode
½á¹ûÈçÏÂ
barcode length serial
b1 10 1
b2 20 2
b2 20 3
b3 30 4
b3 30 5
b3 30 6
ÄÜ·ñÓÐsqlʵÏÖÏÂÃæµÄ½á¹û£º
barcode length serial
b1 10 1
&nbs
Ïà¹ØÎÊ´ð£º
sql table±íÓиöÎı¾ÀàÐ͵Äa×ֶΣ¬´æ´¢µÄÄÚÈÝÈ«²¿ÊÇÊý×Ö£¬ÀýÈç2009001£¬2008578ÕâÑùµÄ¸ñʽ£»b×Ö¶ÎÎı¾ÀàÐÍ£¬´æµÄÒ²ÊÇÊý×ÖÀýÈç 001£¬123
aspÀïÃæ strday=100£¬strb=001
ÎÒÏë¶Á³ö£¬´Óa×ֶεÄÊý×Ö°´´óµ½Ð¡µÄË ......
ÓÐÒ»¸ö±íAA
name tj
1 a
1 b
1 c
2 a
2 d
3 b
ÒªÇóµ±tj×ֶεÄÖµ¼ÈµÈÓÚaÓÖµÈÓÚcʱ£¨tj = ¡®a¡ ......
²éѯ½á¹û¼¯£º
ps online totle
a 0 10
b 1 11
c 5 8
ÏëÏÔʾ³ÉÕâÑù ......
Êý¾Ý¿âij±í£¬Ï뽫ÆäÖÐf1,f2Á½¸ö×ֶεÄÄÚÈÝ·10±¶£¬Çë½ÌÈçºÎд·¨£¿
update tbl set f1= f1*10£¬f2= f2*10 where id=10451
ÕâÖÖд·¨»áÔì³Éplsql¿¨ËÀ
²»»á°É£¬ÄǸöid=10451 µÄÊý¾ÝÓжàÉÙ°¡~~~~
ÎÒ¹À¼ÆsqlÊDz» ......
±ÈÈç ÓÐÒ»×Ö¶ÎΪ£º
Num
6111
6201
6520
65121
60087
46300
ÎÒÏë°Ñ6¿ªÍ·µÄÈ«¶¼Ìæ»»³É5¿ªÍ·
×¢ÒâÕâÊDZíÀïµÄÊý¾Ý£¬ÎÒÏëÓÃSQLÓï¾äʵÏÖÌæ»»
SQL code:
update tb set
num = s ......