这两天闲着无事,写了一个MFC下对话框工程的查询小应用软件,由此引发了一系列血案:《血案五》
sql.Format(_T("update table set iTemp=%d where varchar1='%s'"),strTemp1,iValue);//注意加上sql语句中的单引号
2.生成虚表
sql = "字段1,substring(字段2,11,len(字段2)) as 新字段,(case substring(字段3,1,1) when '包含此字符' then '新字段' when '包含此字符' then '新字段' end) as 新字段,substring(某字段,2,1) as 新字段,3,4)+'-'+substring(某字段,7,2)+'-'+substring(某字段,9,2) as 新字段,(case substring(某字段,2) when '等于此字符串' then '新字段' when '' then '' when '' then '' when '' then '' when '' then '' end) as 新字段,4,len(某字段)) as 新字段,convert(varchar,某字段,120) as 新字段,120) as 新字段";
select top 3 from table;//选出头三条记录
select top 3 * from table where (某字段 not in (select top 10 from table order by 某字段)) order by 某字段
小结:唉,真是应了那句话“出来混早晚是要还滴”,当年数据库没有学好,今天是尝到了苦头。。。。。。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。