VARCHAR2字段关联

SQL> create table a1(id int,name varchar2(10));



Table created.







SQL> create table a2(id int,name varchar2(10));



Table created.



SQL> insert into a1 values(1,'a');



1 row created.



Commit complete.



SQL> insert into a2 values(100,'a'||CHR(13));



1 row created.



SQL> COMMIT;



Commit complete.



SQL> SELECT * FROM A1;



	ID NAME

---------- ----------

	 1 a



SQL> SELECT * FROM A2;



	ID NAME

---------- ----------

       100 a



SQL> SELECT DUMP(NAME) FROM A1;



DUMP(NAME)

--------------------------------------------------------------------------------

Typ=1 Len=1: 97





Typ=1 Len=1: 97



SQL> select length(name) from a1;



LENGTH(NAME)

------------

	   1



--------------------------------------------------------------------------------

SQL> select dump(name) from a2;



DUMP(NAME)



Typ=1 Len=2: 97,13



SQL> select length(name) from a2;



LENGTH(NAME)

------------

	   2



SQL> 

SQL> 

SQL> select * from a1,a2

  2  where a1.name=a2.name;



no rows selected





SQL> select * from a1,a2

  2   where a1.name=replace(a2.name,CHR(13),'');



	ID NAME 	      ID NAME

---------- ---------- ---------- ----------

	 1 a		     100 a


 

你可能感兴趣的:(varchar)