从varchar SQL中提取前6个字符变得越来越老了 [英] exctracting the first 6 characters from a varchar SQL an getting age

查看:173
本文介绍了从varchar SQL中提取前6个字符变得越来越老了的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道我是否具有如下身份号码(780539878676)作为varchar,我想提取前6个字符并从该身份号码中获取年龄,我该怎么做?在SQL 2005中

Hi i would like to know if i have an identity number as follows (780539878676) as a varchar and i want to pull out the first 6 characters and get the age from this identity number how do i do that? in SQL 2005

推荐答案

select substring(''780539878676'', 1,6)为您提供前6个字符.但是,您指的是几岁?日期在该字符串中的何处存储?请澄清.
select substring(''780539878676'', 1,6) gets you the first 6 characters. However, to what age do you refer? Where in that string is a date stored? Please clarify.


这篇关于从varchar SQL中提取前6个字符变得越来越老了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆