Home > database >  About Oracle11g fuzzy query, head hurts...
About Oracle11g fuzzy query, head hurts...

Time:12-19

Great god explain reason, genuflect is begged and helping to hand told the solution, fuzzy query about Oracle11gR1 version

Data table creation fields and data is as follows:

` ` ` PLSQL
- create stuinfo data table
The create table stuinfo (
StuNum char (8),
The Name char (20),
The Age int,
Gender char (2),
The Class char (3)
);
- stuinfo table insert data
Insert into stuinfo values (' 80190001 ', 'Andy lau, 28,' male ', '314');
Insert into stuinfo values (' 80190002 ', 'zhang jie, 17,' male ', '314');
Insert into stuinfo values (' 80190003 ', 'three li, 18,' female 'and' 314 ');
Insert into stuinfo values (' 80190004 ', 'uproot shayna, 16,' female 'and' 315 ');
Insert into stuinfo values (' 80190005 ', 'Liu Sanjie, 18,' male ', '315');
Insert into stuinfo values (' 80190006 ', 'Zhang Jiesan, 24,' male ', '315');
Insert into stuinfo values (' 80190007 ', 'Zhang Jiejie, 25,' male ', '316');
Insert into stuinfo values (' 80190008 ', 'Cecilia liu, 21,' female 'and' 316 ');
Insert into stuinfo values (' 80190009 ', 'Nicholas tse, 18,' male ', '316');
` ` `

Fuzzy query now

The first is very simple, the query name contains three

SQL statements are as follows:

` ` ` PLSQL
Select * from stuinfo where name like '% thirty percent';
` ` `

The results are as follows:

1 80190003 three li 18 women 314
2 80190005 Liu Sanjie 18 male 315
3 80190006 Zhang Jiesan 24 male 315

The second: find the name contains jie

SQL statements are as follows:

` ` ` PLSQL
Select * from stuinfo where name like '% % jie';
` ` `

The results are as follows:

1 80190002 zhang jie 17 male 314
2 80190005 Liu Sanjie 18 male 315
3 80190006 Zhang Jiesan 24 male 315
4 80190007 Zhang Jiejie 25 male 316

Pit dad place: find the name has jie at the end of the

SQL statements are as follows:

` ` ` PLSQL
Select * from stuinfo where name like '% jie';
` ` `

This we won't be able to query a result, very unusual



In PL/SQL Developer is this kind of situation, I thought it was a software problem

In SQL Developer also is such, I can understand that is a question of encoding format

Even in the SQL Plus, too, the last show did not selected row

The first and the second fuzzy query is very normal, just the last

Very helpless, please inform the reason, thanks to the great god first here
  • Related