1 echo Create table t1(f1 varchar(10), f2 char(10), f3 varchar(10), f4 int);
2 Create table t1(f1 varchar(10), f2 char(10), f3 varchar(10), f4 int);
3 Insert into t1 values('CSQL1', 'LAKS1','BBSR1',10);
4 Insert into t1 values('CSQL1', 'LAKS1','BBSR2',20);
5 Insert into t1 values('CSQL1', 'LAKS2','BBSR3',30);
6 Insert into t1 values('CSQL1', 'LAKS2','BBSR4',40);
7 Insert into t1 values('CSQL2', 'LAKS3','BBSR5',50);
8 Insert into t1 values('CSQL2', 'LAKS3','BBSR6',60);
9 Insert into t1 values('CSQL2', 'LAKS4','BBSR7',70);
10 Insert into t1 values('CSQL2', 'LAKS4','BBSR8',80);
11 echo select * from t1;
13 echo update t1 set f3='Orissa1',f4=100 where f3='BBSR1' and f1='CSQL1';
14 update t1 set f3='Orissa1',f4=100 where f3='BBSR1' and f1='CSQL1';
15 echo select * from t1;
17 echo update t1 set f3='Orissa1',f4=100 where not(f3='BBSR1') and f1='CSQL2';
18 update t1 set f3='Orissa1',f4=100 where not(f3='BBSR1') and f1='CSQL2';
19 echo select * from t1;
21 echo update t1 set f3='Orissa2',f4=200 where f3='BBSR2' or f1='CSQL1';
22 update t1 set f3='Orissa2',f4=200 where f3='BBSR2' or f1='CSQL1';
23 echo select * from t1;
25 echo update t1 set f3='Orissa3',f4=300 where f1='CSQL1' and f3 like '__issa2';
26 update t1 set f3='Orissa3',f4=300 where f1='CSQL1' and f3 like '__issa2';
27 echo select * from t1;
29 echo update t1 set f3='Orissa4',f4=400 where f2='LAKS2' and f3 like '_r%3';
30 update t1 set f3='Orissa4',f4=400 where f2='LAKS2' and f3 like '_r%3';
31 echo select * from t1;
33 echo update t1 set f3='Orissa4',f4=400 where not(f3='Orissa1') or f2 in ('LAKS3','LAKS5');
34 update t1 set f3='Orissa4',f4=400 where not(f3='Orissa1') or f2 in ('LAKS3','LAKS5');
35 echo select * from t1;
37 echo update t1 set f3='Orissa4',f4=400 where not(f3='Orissa1') or f2 in ('LAKS3',NULL);
38 update t1 set f3='Orissa4',f4=400 where not(f3='Orissa1') or f2 in ('LAKS3',NULL);
39 echo select * from t1;
41 echo update t1 set f3='Orissa5',f2='LAKS5' where f1='CSQL1' and f3 like 'O_is_a4';
42 update t1 set f3='Orissa5',f2='LAKS5' where f1='CSQL1' and f3 like 'O_is_a4';
43 echo select * from t1;