oracleÖаüÀ¨Ä³¸ö×Ö·ûÓÃʲôÌåÏÖ³öÀ´
oracleÖаüÀ¨Ä³¸ö×Ö·ûµÄÌåÏÖÒªÁìΪ£ºÊ¹ÓÃͨÅä·û %£¬ÌåÏÖÆ¥Åäí§ÒâÊýÄ¿µÄí§Òâ×Ö·û¡£Ó÷¨£ºselect * from table_name where column_name like ‘%character%’¡£ ±ðµÄ£¬oracle»¹ÌṩÆäËûͨÅä·û£º_ Æ¥Åäµ¥¸ö×Ö·û£»[] Æ¥Åä·½À¨ºÅÄÚµ¥¸ö×Ö·û£»[^] Æ¥Åä·½À¨ºÅÍâµ¥¸ö×Ö·û¡£
Oracle ÖаüÀ¨Ä³¸ö×Ö·ûµÄÌåÏÖÒªÁì
ÔÚ Oracle ÖУ¬°üÀ¨Ä³¸öÌض¨×Ö·û¿ÉÒÔʹÓÃͨÅä·û %¡£% ÌåÏÖÆ¥Åäí§ÒâÊýÄ¿£¨°üÀ¨Áã¸ö£©µÄí§Òâ×Ö·û¡£
Ó÷¨
Òª²éÕÒ°üÀ¨Ìض¨×Ö·ûµÄ×Ö·û´®£¬ÇëʹÓÃÒÔÏÂÓï·¨£º
SELECT * FROM table_name WHERE column_name LIKE '%character%';
µÇ¼ºó¸´ÖÆ
ÆäÖУº
table_name ÊÇÄãÒªËÑË÷µÄ±íÃû¡£
column_name ÊÇÄãÒªËÑË÷µÄÁÐÃû¡£
character ÊÇÄãÒª²éÕÒµÄ×Ö·û¡£
ʾÀý
Òª²éÕÒ°üÀ¨×Öĸ “a” µÄËùÖøÃû³Æ£¬¿ÉÒÔʹÓÃÒÔÏÂÅÌÎÊ£º
SELECT * FROM employee WHERE name LIKE '%a%';
µÇ¼ºó¸´ÖÆ
ÆäËûͨÅä·û
³ýÁË % Ö®Í⣬Oracle »¹ÌṩÁËÆäËûͨÅä·ûÓÃÓÚģʽƥÅ䣺
_£¨Ï»®Ïߣ©£ºÆ¥ÅäÈκε¥¸ö×Ö·û¡£
[]£¨·½À¨ºÅ£©£ºÆ¥Åä·½À¨ºÅÄÚÖ¸¶¨µÄÈκε¥¸ö×Ö·û¡£
[^]£¨¸º·½À¨ºÅ£©£ºÆ¥Åä·½À¨ºÅÄÚδָ¶¨µÄÈκε¥¸ö×Ö·û¡£
ÌáÐÑ
% ÊÇÒ»¸öͨÅä·û£¬Òò´ËÇëÉóÉ÷ʹÓÃËü£¬ÒÔÃâ»ñ×ÔµÃÍâЧ¹û¡£
ÈôÊÇÒª²éÕÒÌض¨×Ö·ûÐòÁУ¬¿ÉÒÔʹÓà _ È¡´ú %¡£
¿ÉÒÔÔÚͨÅä·ûÖÐʹÓÃתÒå×Ö·û \ À´²éÕÒÌØÊâ×Ö·û£¨Èç % »ò _£©¡£
ÒÔÉϾÍÊÇoracleÖаüÀ¨Ä³¸ö×Ö·ûÓÃʲôÌåÏÖ³öÀ´µÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡