日期:2014-05-18 浏览次数:20452 次
SELECT * FROM [TABLE] WHERE [COLUMN] LIKE ‘%KeyWord%’ SELECT * FROM [TABLE] WHERE [COLUMN] LIKE ‘%keyword%’
use tempdb set nocount on --1-- print '建立初始数据表Customer' create table Customer(id int,uname varchar(10)) insert into Customer select 1,'Jim' union all select 2,'Simith' union all select 3,'uonun' select * from Customer --2-- print '建立初始数据表Info' create table Info(uname varchar(10),phone varchar(11)) insert into Info select 'JIM','13800000000' union all select 'Simith','13911111111' union all select 'uonun','13812345678' select * from Info --3-- print '不区分大小写,不区分全半角' select c.id,c.uname as 'c.uname',i.uname as 'i.uname',i.phone from Customer as c inner join Info as i on c.uname = i.uname --4-- print '区分大小写,不区分全半角' select c.id,c.uname as 'c.uname',i.uname as 'i.uname',i.phone from Customer as c inner join Info as i on c.uname = i.uname collate Chinese_PRC_CS_AS --5-- print '不区分大小写,区分全半角' select c.id,c.uname as 'c.uname',i.uname as 'i.uname',i.phone from Customer as c inner join Info as i on c.uname = i.uname collate Chinese_PRC_CI_AI_WS --6-- print '区分大小写,区分全半角' select c.id,c.uname as 'c.uname',i.uname as 'i.uname',i.phone from Customer as c inner join Info as i on c.uname = i.uname collate Chinese_PRC_CS_AI_WS DROP TABLE Customer DROP TABLE Info /* 建立初始数据表Customer id uname ----------- ---------- 1 Jim 2 Simith 3 uonun 建立初始数据表Info uname phone ---------- ----------- JIM 13800000000 Simith 13911111111 uonun 13812345678 不区分大小写,不区分全半角 id c.uname i.uname phone ----------- ---------- ---------- ----------- 1 Jim JIM 13800000000 2 Simith Simith 13911111111 3 uonun uonun 13812345678 区分大小写,不区分全半角 id c.uname i.uname phone ----------- ---------- ---------- ----------- 2 Simith Simith 13911111111 3 uonun uonun 13812345678 不区分大小写,区分全半角 id c.uname i.uname phone ----------- ---------- ---------- ----------- 1 Jim JIM 13800000000 3 uonun uonun 13812345678 区分大小写,区分全半角 id c.uname i.uname phone ----------- ---------- ---------- ----------- 3 uonun uonun 13812345678 */