数据库:SqlServer
--create table--
create table table1 (
column1 nvarchar(200),
column2 nvarchar(200)
);
--insert data--
insert into table1(column1,column2) values ('_abc_','aasf');
insert into table1(column1,column2) values ('_acbc_','aasf');
insert into table1(column1,column2) values ('23','ggg');
insert into table1(column1,column2) values ('_def_','aasf');
insert into table1(column1,column2) values ('asdf','3123');
--search as type--
Select
type = case when column1 like '%_abc_%' then 'a'
when column2 like '%GGG%' then 'b'
when column1 like '%_def_%' then 'c'
else 'others' end,
column1,
column2
from table1
where 1=1
分享到:
相关推荐
在SQLServer中分组时:不能以text,ntext,image类型的字段作为分组依据 在selecte统计函数中的字段,不能和普通的字段放在一起; 13、对数据库进行操作: 分离数据库: sp_detach_db; 附加数据库:sp_attach_db 后...
Although 2 GB of address space may seem like a large amount of memory, application such as SQL Server could leverage more memory if it were available. The boot.ini option /3GB was created for those ...
if exists (select * from tempdb.sys.all_objects where name like '%#dbsize%') drop table #dbsize create table #dbsize (Dbname varchar(30),dbstatus varchar(20),Recovery_Model varchar(10) default ('NA'),...
If you build a clustered index without specifying the unique keyword, SQL Server forces uniqueness by adding a uniqueifier to the rows when necessary. This uniqueifier is a 4-byte value added as an ...
SQL数据库:select case when len(field)>10 then left(field,10)+'...' else field end as news_name,news_id from tablename Access数据库:SELECT iif(len(field)>2,left(field,2)+'...',field) FROM ...
在SQLServer中分组时:不能以text,ntext,image类型的字段作为分组依据 在selecte统计函数中的字段,不能和普通的字段放在一起; 13、对数据库进行操作: 分离数据库: sp_detach_db; 附加数据库:sp_attach_db 后...
在SQLServer中分组时:不能以text,ntext,image类型的字段作为分组依据 在selecte统计函数中的字段,不能和普通的字段放在一起; 13、对数据库进行操作: 分离数据库: sp_detach_db; 附加数据库:sp_attach_db ...
在SQLServer中分组时:不能以text,ntext,image类型的字段作为分组依据 在selecte统计函数中的字段,不能和普通的字段放在一起; 13、对数据库进行操作: 分离数据库: sp_detach_db; 附加数据库:sp_attach_db 后...
SQL sever 2008 Rar! ?s X祕BwL0 17240671-1.sql ?年3月9日 --1.查询course表的所有信息(所有行所有列) USE Xk GO SELECT * FROM Course --有哪些种类的选修课?学分是多少 USE XK GO SELECT Kind,Credit FROM ...
5.8 The Case Expression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 5.9 The Scalar Expression Between Brackets . . . . . . . . . . . . . . . . 106 viii Contents 5.10 The Scalar...
SqlLamdalf.FactoryAnna factorySql = new SqlLamdalf.FactoryAnna(AnnaType.SqlServer, "Persist Security Info=False;Integrated Security=SSPI;Database=数据库名称;Server=sql服务器名称"); //对需要的表的...
Added a "forgot scan" option (in case you forgot what you're doing) Pointerscan limit nodes is default on in a new ce install (remembers your choice when you disable it) Autoattach now happens using a...
<END><br>34,DAOLike.zip This program Demonstrates how to use LIKE operator in Jet SQL Query (uses DAO).<END><br>35,xmlcreator.zip This project is a demonstration of how to convert a recordset ...
can send SQL expressions on the server through the corresponding access engine. It is TBDEDataDriverEh, TIBXDataDriverEh, TDBXDataDriverEh and TADODataDriverEh component. There are a ...
can send SQL expressions on the server through the corresponding access engine. It is TBDEDataDriverEh, TIBXDataDriverEh, TDBXDataDriverEh and TADODataDriverEh component. There are a ...
数据查询语言 (Data Query Language, DQL) 是SQL语言中,负责进行数据查询而不会对数据本身进行修改的语句,这是最基本的SQL语句。例如:SELECT(查询) 数据控制语言Data Controlling Language(DCL),用来...
MySQL中约束保存在information_schema数据库的table_constraints中,可以通过该表查询约束信息; 约束主要完成对数据的检验,保证数据库数据的完整性;如果有相互依赖数据,保证该数据不被删除。 常用五类约束: ...
Directive names are *case sensitive* - foo=bar is different from FOO=bar. ; Directives are variables used to configure PHP or PHP extensions. ; There is no name validation. If ...
能自动清理HTML代码中Word标记 <br/>When text is pasted from Microsoft Word allot of unnecessary word specific markup is carried across. This can result in web pages that take an ...
Deciding When to Use DBM and When to Use a Relational Database 255 Working with Relational Databases 255 Writing SQL Statements 257 Defining Tables 259 Setting Up a Database 260 Try It Out: ...