SQL 2000 中,查询某个字段的值中第一个字是汉字的语句如何写?
解决方案 »
- 如何将表t1所有子路的字段a更新到另一张表
- 数据库跨库查询效率问题
- 请教从设备恢复数据库时报空间不够,但硬盘空间还有8个G没有,提示could not create one or more files. conside suing the WITH
- 简单统计问题
- 分区视图的更新
- 如何用sql 2005的库新建视图读取2000的表
- sql 按列A分组后只保留B列最大行的数据
- 删除表中所以记录时怎样才能让整型自增从1开始重计?
- 请问如何将SQL Server2000得数据库降到SqlServer7
- 字段内容提取(我有一个sql server表,里面有一个字段,是用逗号作为分隔符的,如何提取有效信息)
- 求加权平均值
- 请问如何按月度汇总
---------------------------------------------------------------
-- DESIGNER :happycell188(喜喜)
-- QQ :584738179
-- Development Tool :Microsoft Visual C++ 6.0 C Language
-- FUNCTION :CONVERT DATA TO T-SQL
---------------------------------------------------------------
-- Microsoft SQL Server 2005
-- Developer Edition on Microsoft Windows XP [版本 5.1.2600]
---------------------------------------------------------------
---------------------------------------------------------------use test
go
if object_id('test.dbo.tb') is not null drop table tb
-- 创建数据表
create table tb
(
id int,
name char(5)
)
go
--插入测试数据
insert into tb select 1,'jone'
union all select 2,'李四'
union all select 3,'Lili'
union all select 4,'王五'
goselect * from tb where ascii(left(ltrim(name),1))>127 or ascii(right(name,1))<0/*
id name
---------------
2 李四
4 王五(2 行受影响)
*/
select * from tb where ascii(left(name,1))>127 or ascii(left(name,1))<0
where col like '[吖-咗]%'
SELECT col from 表名 WHERE left(col,1) LIKE '[吖-做]%'楼主试试这个对不对
都对