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×ֶεÄÊý×Ö°´´óµ½Ð¡µÄË ......
create table [¿Í»§ÁªÏµ±í]([¿Í»§±àºÅ] varchar(2),[ÁªÏµÈÕÆÚ] datetime,[ÁªÏµÄÚÈÝ] int)
insert [¿Í»§ÁªÏµ±í]
select 'aa','2009/01/01',111 union all
select 'bb','2009/02 ......
INSERT INTO StudAchieve(studID,studName)
VALUES('2','abc'),('2','bcd'),('2','cde')
Æ´Á˰ëÌìÒ²²»¶Ô£¬¼°°¡ ¡£¡£¡£¡£
SQL c ......
²éѯ½á¹û¼¯£º
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» ......