由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Database版 - 请教:sql, string operation
相关主题
如何格式化sql输出?Like 和 equal 啥区别?
A simple question for SQL, seeking helpT-SQL 问题
how to query chinese in mysql?need some help on how to parse a field
Access中有如substring和dateadd的函数是什么? 转换成时间的格式 MS SQL
老板的无理要求!(希望熟悉Oracle的朋友指点)PL SQL 问题
Re: 诚心请教 (SQL) => Try This Please:how to extract text
delete characters between parentheses?How to split a column into several rows?
一个关于T-SQL的问题把城市从地址里剥离出来
相关话题的讨论汇总
话题: file话题: directory话题: string话题: substring话题: size
进入Database版参与讨论
1 (共1页)
n********6
发帖数: 1511
1
Objective: To get the file size and put into col
Problem: file size increase to the left, the following script get the output
like '30 MITBBS_ID_...'
STEP 1:
shell, bcp, get dirlist.txt like below:
...
09/12/2011 02:50 PM 30 MITBBS_id_TEST001.TXT
...
STEP 2:
SELECT RTRIM(SUBSTRING(Directory_string, 40, 80)) AS FILE_NAME_IN,
RTRIM(SUBSTRING(Directory_string, 1, 20)) AS FILE_DATE,
LTRIM(SUBSTRING(Directory_string, 21, 40)) AS FILE_SIZE
FROM ##P_Import_ORR_ORIG_DOC_Directory
i****a
发帖数: 36252
2
use "space" as seperators. search for 1st non-space character after a space
for next field

output

【在 n********6 的大作中提到】
: Objective: To get the file size and put into col
: Problem: file size increase to the left, the following script get the output
: like '30 MITBBS_ID_...'
: STEP 1:
: shell, bcp, get dirlist.txt like below:
: ...
: 09/12/2011 02:50 PM 30 MITBBS_id_TEST001.TXT
: ...
: STEP 2:
: SELECT RTRIM(SUBSTRING(Directory_string, 40, 80)) AS FILE_NAME_IN,

n********6
发帖数: 1511
3
Thank you. Will try.

space

【在 i****a 的大作中提到】
: use "space" as seperators. search for 1st non-space character after a space
: for next field
:
: output

1 (共1页)
进入Database版参与讨论
相关主题
把城市从地址里剥离出来老板的无理要求!(希望熟悉Oracle的朋友指点)
这个新功能我喜欢Re: 诚心请教 (SQL) => Try This Please:
求教一个mysql的select优化delete characters between parentheses?
MySQL question一个关于T-SQL的问题
如何格式化sql输出?Like 和 equal 啥区别?
A simple question for SQL, seeking helpT-SQL 问题
how to query chinese in mysql?need some help on how to parse a field
Access中有如substring和dateadd的函数是什么? 转换成时间的格式 MS SQL
相关话题的讨论汇总
话题: file话题: directory话题: string话题: substring话题: size