怎么提取一个表当中某一字段后5位相同的记录?

welcomeplay 2003-06-13 11:40:28
怎么提取一个表当中某一字段后5位相同的记录?
...全文
33 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
hjb111 2003-06-13
  • 打赏
  • 举报
回复
select * from table where right(rtrim(columnname),5)='5个字符串'
tttzms 2003-06-13
  • 打赏
  • 举报
回复
首先找出相同的5个字的子串.
tttzms 2003-06-13
  • 打赏
  • 举报
回复
select * from <table> where RIGHT(<field>, 5) in (select RIGHT(<field>, 5) from <table> group by RIGHT(<field>, 5) having count(*)>1)
pbsql 2003-06-13
  • 打赏
  • 举报
回复
SELECT right(字段,5) from 表 group by right(字段,5)
caiyunxia 2003-06-13
  • 打赏
  • 举报
回复
select * from table where right(rtrim(columnname),5)='12345'
nboys 2003-06-13
  • 打赏
  • 举报
回复
select * from table_name where column1=right(column2,5)
erigido 2003-06-13
  • 打赏
  • 举报
回复
select * from table where right(rtrim(columnname),5)='12345'
highman 2003-06-13
  • 打赏
  • 举报
回复
同意tttzms(网缘)
ljx0486 2003-06-13
  • 打赏
  • 举报
回复
select t1.* from tablename t1,tablename t2
where right(rtrim(t1.columnname),5)=right(rtrim(t2.columnname),5)
and t1.columnname <> t1.columnname
dafu71 2003-06-13
  • 打赏
  • 举报
回复
select * from yourtable where right(rtrim(columnname),5)='yourcondition'
97866 2003-06-13
  • 打赏
  • 举报
回复
Select * from TableName where SubString(FieldName,Len(FieldName)-4,5)='55555'

34,590

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧