坚度数据导出说明
一.导出方案
1.1 选择数据库-->数据右键-->任务-->导入数据
1.2 选择“下一步”
1.3 选择数据源
1.4 选择导出目标
1.5 点击“浏览”选择文件保存类型
1.6 选好了直接下一步
1.7 选择要导出的表或者视图
1.8 输入导出语句
sql语句输入导出脚本的相关语句即可
会员导出脚本
select cname as 会员姓名, ptelephone as '联系电话', case sex when 1 then '男' when 2 then '女' else '男' end as '性别', borndate as '公历生日', HYLX as '会员等级',
case state when 1 then '启用' when 2 then '停用' when 6 then '挂失' else '未知' end as '卡状态',
CustomNO as '会员卡号', isnull(syje,0) as '剩余金额', applydate as '建卡时间', enddate as '有效期'
from (
select a.borndate, a.CustomNO,a.IDCardNo,a.HYLXID,a.cname,a.password,
a.passbookid,a.marry,a.ptelephone,a.addr,a.ppostcode,a.companyname, a.companyaddr,a.ctelephone,a.faxno,a.email,a.cpostcode,a.proposer,a.givedate,
a.startdate,a.enddate,a.saveamot,a.Presentamot,a.applyDate,a.fmwhere,a.HYJF,a.zpimage, a.billtotal,a.updateDate,a.updateFlag,a.sync_stat, a.xf_psw,a.DANHAO,a.ImageFileName ,a.rowguid,a.storeid, a.authtelr,
a.vselfDef4,a.vselfDef5,a.vselfDef2,a.vselfDef3, a.cardType,a.maketelr , (case when a.sex not in (0,1,2) then 0 else a.sex end) sex,
(case when a.state not in (1,2,3,4,5,6,7,8) then -1 else a.state end) state,
(case when (isnull(iselfDef1,0) & 1)=1 then '是' else '否' end) bdxs, b.syjf,d.zjf, b.syje,b.zhzh,b.posje,b.roomje,a.memo, e.HYLX,e.HYZK
from lr_hy_hyzl a left outer join (select customno, round(isnull(sum(jf),0),2) as syjf, round(isnull(sum(je),0),2) as syje, round(isnull(sum(zsje),0),2) as zhzh,
round(isnull(sum(posje),0),2) as posje, round(isnull(sum(roomje),0),2) as roomje from lr_hy_core where (actions in (1, 2, 4)) group by customno) b on a.customno = b.customno
left outer join (select customno, round(isnull(sum(jf),0),2) as zjf from lr_hy_core where (actions in (4,7)) group by customno) d on a.customno = d.customno
left join lr_hy_hylx e on e.hylxid=a.hylxid
) f
where 1=1
order by f.applyDate desc
公关导出脚本
select
(select cateName from [dbo].[prd_cate] where cateIds=prd_person.cateIds) '类别',
(select levelName from [dbo].[prd_level] where levelIds=prd_person.levelIds) '级别',
personName as '姓名',
personStage as '艺名',
personCode as '代号',
isnull(cardNo,'') as '卡号',
isnull(tel,'') as '电话',
isnull(idenNo,'') as '身份证',
personFee as '余额'
from prd_person
where 1=1
and isnull(personIsStop,0)=0