日期:2014-05-17  浏览次数:20623 次

select语句能不能用用mid()等字符型函数截取字段值或者clng()转换字段值或者?
具体是这样:
      table表中的出生日期是字符型的,比如:“19780101”

能不能这样写:
      select   t.file   form   table   t   where   mid(t.birthday,1,4)= '1978 '

或者这样写:
      select   t.file   form   table   t   where   clng(t.birthday)> 1978   and   clng(t.birthday) <1990

我在asp中用第二中写法,显示错误,称找不到列


------解决方案--------------------
substr()截取
------解决方案--------------------
to_number()转换
------解决方案--------------------
没有mid -> substr
没有clng 你这是啥意思?
------解决方案--------------------
clng是javascript的函数吧, 怎么能在SQL中用呢
------------------------------------------------
SELECT t.file
FROM table1 t
WHERE to_number(t.birthday) > 19780000
AND to_number(t.birthday) < 19909999