日期:2014-05-18 浏览次数:20484 次
SELECT dbo.userlib.u_id, dbo.Company.C_company, DATEDIFF(day, dbo.userlib.U_regdate, GETDATE()) AS years, dbo.userlib.U_level, Keyword = CASE WHEN dbo.Company.c_Keyword like '本机地址' or dbo.Company.c_Keyword like '%[,]本机地址[,]%' or dbo.Company.c_Keyword like '%[,]本机地址' or dbo.Company.c_Keyword like '本机地址' THEN 1 ELSE 0 END, CASE WHEN u_level = 3 THEN 3 WHEN u_level = 2 THEN 3 WHEN u_level = 1 THEN 2 ELSE 0 END AS vip_level, c_keyword = CASE WHEN dbo.company.c_Keyword IS NULL THEN '''' ELSE dbo.company.c_Keyword END, dbo.Company.c_hits, dbo.company.c_address, dbo.company.c_tel, dbo.company.c_a_id, dbo.company.c_c_id, dbo.company.c_cy_id, dbo.company.c_description, c_rtime = case when dbo.company.c_RefreshTime < getdate() or dbo.Company.c_Keyword not like '本机地址' and dbo.Company.c_Keyword not like '%[,]本机地址[,]%' and dbo.Company.c_Keyword not like '%[,]本机地址' and dbo.Company.c_Keyword not like '本机地址[,]%' then '1987-08-28' else dbo.company.c_RefreshTime end FROM dbo.Company INNER JOIN dbo.userlib ON dbo.Company.C_u_id = dbo.userlib.u_id WHERE userlib.u_yes = 1 AND c_company like '%本机地址%' or c_address like '%本机地址%' or c_tel like '%本机地址%' or c_company like '%地址%' or c_address like '%地址%' or c_tel like '%地址%' or c_company like '%本机%' or c_address like '%本机%' or c_tel like '%本机%' or c_company like '%地%' or c_address like '%地%' or c_tel like '%地%' or c_company like '%址%' or c_address like '%址%' or c_tel like '%址%' or c_company like '%本%' or c_address like '%本%' or c_tel like '%本%' or c_company like '%机%' or c_address like '%机%' or c_tel like '%机%' or c_keyword like '本机地址' or c_keyword like '%[,]本机地址[,]%' or c_keyword like '%[,]本机地址' or c_keyword like '本机地址[,]%'