一些sql语句的常用总结(重要)
select primary_flag from tc_contact where primary_flag !=0
select dept_id,dept_name,tree_level,tree_path from tc_department where 
org_id=1 and stop_flag=0 order by tree_path     --部门显示
SELECT * FROM TC_CONTACT where ACCOUNT_ID=1246968   --主视图
select * from TCV_CONTACT where ACCOUNTID=1246968  --联系人
select * from TCV_OPPORTUNITY where ACCOUNTID=1246968  --销售机会
select * from TCV_ACTIVITY where  ACCOUNTID=1246968    --销售行动
SELECT count(t.yckb_id) --参课判定
FROM tcu_yckb t
     inner join tc_contact tc
        on t.yckb_refid01 = tc.contact_id
       and tc.org_id = t.org_id
     inner join tcu_jiaoxplan jp
        on t.yckb_refid02 = jp.jiaoxplan_id
       and t.org_id = jp.org_id
     inner join tc_account khb
        on tc.account_id = khb.account_id
       and khb.org_id = tc.org_id
     where t.yckb_int05 = 1001 -- 参课判定:参加
       and t.qrcode = 'EDC5903AFE4A8777';
SELECT * from tcu_yckb where qrcode = 'EDC5903AFE4A8777' for update;
SELECT * from tcu_yckb where yckb_name like '%盛景网联测试客户八-王小梦-创新梦工厂 - 21%' for update   --9992901D98300000
16:45:45
/mg叶子/mg 2015/5/11 16:45:45
select yckb_id, qrcode, yckb_int06
  from tcu_yckb
 where qrcode = '9992901D98308888';
select * from tc_contact where contact_name = '梁广永';  --记住是contact_ID  还有一个contract_ID  D69D5FC04BF35555  9192901D98308888  E279CF6AF9BF01F7
select * from tcu_yckb   order by create_time desc --where qrcode is not null
select  *   from tcu_yckb where yckb_refid01= 195166
select  *   from tcu_yckb where  yckb_id = 416804  for update --  D69D5FC04BF3C5F0  yckb_refid01= 199933 and
--正式课的签到时间
select * from tcu_jiaoxplan where jiaoxplan_name='投资俱乐部2015-3';    --投资俱乐部2015-3
select * from esi_validcontrol   --6628
for update
insert into esi_validcontrol values('6668','2015/4/29 10:23:39','12284','2015/4/29 10:23:39',0,0)
select yckb_id,
       yckb_name,
       qrcode,
       yckb_int03,
       yckb_int06,
       decode(yckb_int03, 1002, '是', 1001, '否 ') as "签到状态"
  from tcu_yckb
 where qrcode  in('D69D5FC04BF35555','9192901D98308888','9992901D98308888','EDC5903AFE4A6666','EDC5903AFE4A8777','9992901D98309999');
update tcu_yckb set yckb_int03 = 1002 where qrcode    in('EDC5903AFE4A8777'); --设置指定code成已签到
update tcu_yckb set yckb_int03 = 1001 where qrcode    in('EDC5903AFE4A8777'); --设置指定code成未签到
select  t.yckb_int06,decode(t.yckb_int06, 1001, '是' , 1002, '否', 1003, '无名片') "有效到场/合格总裁" 
from tcu_yckb t where qrcode = '9992901D98308888';
select yckb_int06 from tcu_yckb t where qrcode = '9992901D9830888812';
select yckb_int06 from tcu_yckb t where qrcode = 'EDC5903AFE4A8777';
tcu_yckb
select count(yckb_id)
from tcu_yckb
     where qrcode = 'EDC5903AFE4A8777';
--盛景网联APP签到系统讨论组  给他们更新字段的语句
select yckb_id,
       yckb_name,
       qrcode,
       yckb_int03,
       yckb_int06,
       decode(yckb_int03, 1002, '是', 1001, '否 ') as "签到状态"
  from tcu_yckb
 where qrcode  in('EDC5903AFE4A8777','EDC5903AFE4A6666','9992901D98308888');
update tcu_yckb set yckb_int03 = 1001 where qrcode in('9992901D98308888');
--更改未收款金额的代码 19800 ==> 0
select * from tc_contract
select contract_unpayed_amount from tc_contract where account_ID=1246968 for update
select account_ID from tcu_yckb where qrcode in('EDC5903AFE4A8777','EDC5903AFE4A6666');
--没找到符合条件的签到表。
  SELECT count(t.yckb_id)
      FROM tcu_yckb t
     inner join tc_contact tc
        on t.yckb_refid01 = tc.contact_id
       and tc.org_id = t.org_id
     inner join tcu_jiaoxplan jp
        on t.yckb_refid02 = jp.jiaoxplan_id
       and t.org_id = jp.org_id
     inner join tc_account khb
        on tc.account_id = khb.account_id
       and khb.org_id = tc.org_id
     where
    --      jp.jiaoxplan_date01 >= trunc(sysdate)
    --      and (trunc(jp.jiaoxplan_date02 + 1) - 1 / 24 / 60 / 60) > sysdate
-- 当前日期>=报到日(开课日期前一天)0点,其当前日期<=结课日期的23:59:59
     jp.jiaoxplan_date01 - 1 <= trunc(sysdate)
     and trunc(jp.jiaoxplan_date02 + 1) - 1 / 24 / 60 / 60 >= sysdate
     and t.yckb_int03 = 1001 -- 签到状态:否
    --      and t.yckb_type = 2136 -- 正式课
     and t.yckb_int05 = 1001 -- 参课判定:参加
     and t.qrcode = 'EDC5903AFE4A8777';
--教学计划表 修改有效签到时间      也可以改一下那个会的时间  然后在vs运行一下网站设置 注:会议已经结束
select * from  tcu_jiaoxplan where jiaoxplan_name = '投资俱乐部2015-3'
select * from  tcu_jiaoxplan where jiaoxplan_name = '总裁年会-第八届'
select * from esi_validcontrol     for update  --2015/4/30 10:23:30
--相应的学习计划
select tb.yckb_id   from tcu_yckb tb where tb.qrcode = '9992901D98308888' for update --416788
SELECT count(t.ref_1)
      from tcu_yckb_1_1 
     where yckb_id = qdID;
--给这几个人发短信
select * from esi_recipient
select dept_id,dept_name,tree_level,tree_path from tc_department 
where org_id=1 and stop_flag=0 order by tree_path
select * from tcv_contact where accountID=1246968 --NAME like'%zyl%'
select * from tcv_opportunity where accountID=1246968
select * from tcv_contact order by modifiedtime desc
select * from tc_contact order by create_time desc
select t.*, t.rowid from SJ_ACTIVITYSTAGECONFIGURE t
select * from tcv_account_attrs where label like'%股权投资经验%'
select * from tc_audit_stage_define
select * from tcu_basicpdu where basicpdu_name like '%投资导师%'
select * from tc_type where org_id=1 and obj_type=4
--合作伙伴开发销售机会  04
--老客户销售机会   10003
select stage_id,stage_name,stage_type from tc_opportunity_stage where org_id=1 and type_id=2048
--客户开发销售机会   10001
select stage_id,stage_name,stage_type from tc_opportunity_stage where org_id=1 and type_id=2
--邀约机会    10006
select stage_id,stage_name,stage_type from tc_opportunity_stage where org_id=1 and type_id=2241
select * from tc_opportunity_stage where org_id=1 and type_id=2
--224  私人顾问投资导师  825  销售增长计划实操班  712  明星产品实操班
/*  客户开发销售机会
2889294    P0-目标客户开发
1355 P1-建立信赖  
1365  P2-挖掘需求
2889301    P3-价值塑造
105    P4-异议处理
113    P5-赢取承诺(回执)
119    P6-促成收款
126   P7-确认到场
邀约机会
Y1:客户分析与策略    5332444
Y2:建立信赖     5332437
Y3: 挖掘需求     5332428
Y4塑造价值        5332418
Y5: 异议处理      5332399
Y6:赢取承诺      5332392
Y7: 签到         5332409
老客户销售机会
S1:客户分析与策略    5332352
S2 :建立信赖         5332375
S3:挖掘需求         5332370
S4:塑造价值        5332360
S5:异议处理         5332357
S6:赢取承诺          5332354
S7:成交            5332353
*/
S2  tc_account.acct_int05,tc_account.billing_address,tc_account_attr.acct_multi16,tc_account_attr.acct_multi17,tc_account.acct_date08,tc_account.acct_int07,tc_account.acct_int13,tc_account.acct_int17,tc_account.acct_int18,tc_account.acct_char01,tc_account.acct_char02,tc_account.acct_multi06,tc_account_xattr.acct_int50
S3  缺少可调度资金   tc_account_xattr.acct_int51,tc_account_attr.acct_multi08,tc_account_xattr.acct_int53,tc_account_xattr.acct_int52,tc_account_xattr.acct_int54,tc_account_xattr.acct_int55,tc_account_xattr.acct_int56,tc_account_xattr.acct_int57
S4  tc_account_xattr.acct_int58,tc_account_xattr.acct_int59,tc_account_xattr.acct_int60,tc_account_xattr.acct_int61,tc_account_xattr.acct_int62,tc_account_xattr.acct_int63,tc_account_xattr.acct_int64,tc_account_1_1.int_1,tc_account_1_1.int_2,tc_account_1_1.int_3
S5  tc_account_1_1.int_4
tc_account_1_1.int_5,tc_account_attr.acct_multi18,tc_account_1_1.txt_4
select * from tcv_account_attrs where label like'%家庭年收入%'
/*
项目亮点  projecttarget
核心客户  keycustomers
企业核心关注点  concernedpoints
家庭年收入  income
投资性房产  houseproperty
理财产品  financialproducts
股票  stock
小额贷  loan
股权投资经验  investmentexperience
在风险可控的前提下,5年内期望回报的倍数  expected eturn
是否有明确的资产配置需求  ifassetrequirement
是否有中长期股权投资理念  ifequityinvestment
是否听过股权选修课  ifoptionalcourse
是否了解母基金的运作模式  ifknowfund
是否参加过基金募集  iffundraising
是否对发布的某支母基金动过心  ifinterestedfund
是否知道要投母基金要购买投资导师  ifconditionoffund
是否知道投资导师的内容价值和价格  ifknowvalue
大区是否提前介入沟通	ifcommunication
是否谈过投资导师	ifcourse
客户抗拒点	ifcustomerpoint
财务电话	financalnumber
财务姓名	financalname
微信号	wechatnumber
收入平均增长率	growthrate
销售方式	salesmode
公司产品的规划思路和竞争策略	companyplan
是否有各类产品的CDBFA	ifproductinfo
*/
一些sql语句的常用总结(重要)的更多相关文章
- 浅谈MySQL中优化sql语句查询常用的30种方法 - 转载
		浅谈MySQL中优化sql语句查询常用的30种方法 1.对查询进行优化,应尽量避免全表扫描,首先应考虑在 where 及 order by 涉及的列上建立索引. 2.应尽量避免在 where 子句中使 ... 
- Mybatis 动态Sql语句《常用》
		MyBatis 的强大特性之一便是它的动态 SQL.如果你有使用 JDBC 或其他类似框架的经验,你就能体会到根据不同条件拼接 SQL 语句有多么痛苦.拼接的时候要确保不能忘了必要的空格,还要注意省掉 ... 
- mysql中sql语句的常用语句
		1:提取公共的sql语句: 2:动态添加----sql语句: 代码: <insert id="test1" parameterType="com.floor.sho ... 
- MySQL中优化sql语句查询常用的30种方法
		1.对查询进行优化,应尽量避免全表扫描,首先应考虑在 where 及 order by 涉及的列上建立索引. 2.应尽量避免在 where 子句中使用!=或<>操作符,否则将引擎放弃使 ... 
- MySQL中优化sql语句查询常用的种方法
		1.对查询进行优化,应尽量避免全表扫描,首先应考虑在 where 及 order by 涉及的列上建立索引. 2.应尽量避免在 where 子句中使用!=或<>操作符,否则将引擎放弃使用索 ... 
- 浅谈MySQL中优化sql语句查询常用的30种方法
		1.对查询进行优化,应尽量避免全表扫描,首先应考虑在 where 及 order by 涉及的列上建立索引. 2.应尽量避免在 where 子句中使用!=或<>操作符,否则将引擎放弃使用索 ... 
- Mysql 性能优化7【重要】sql语句的优化  浅谈MySQL中优化sql语句查询常用的30种方法(转)
		原文链接 http://www.jb51.net/article/39221.htm 这篇文章大家都在转载,估计写的有条理吧,本人稍微做一下补充 1.对查询进行优化,应尽量避免全表扫描,首先应考虑 ... 
- mysql补充(3)优化sql语句查询常用的30种方法
		1.对查询进行优化,应尽量避免全表扫描,首先应考虑在 where 及 order by 涉及的列上建立索引. 2.应尽量避免在 where 子句中使用!=或<>操作符,否则将引擎放弃使用索 ... 
- 浅谈 MySQL 中优化 SQL 语句查询常用的 30 种方法
		1.对查询进行优化,应尽量避免全表扫描,首先应考虑在 where 及 order by 涉及的列上建立索引. 2.应尽量避免在 where 子句中使用!=或<>操作符,否则将引擎放弃使用索 ... 
随机推荐
- (5) 深入理解Java Class文件格式(四)
			转载:http://blog.csdn.net/zhangjg_blog/article/details/21658415 前情回顾 在上一篇博客深入理解Java Class文件格式(三) 中, ... 
- (1) 第一章 Java体系结构介绍
			1.网络带来的挑战和机遇 (1).挑战一: 网络包含的设备越来越广泛, 硬件体系不同, 操作系统不同,用途不同. java解决办法: 通过创建与平台无关的程序来解决这个问题.一个java程序可以不需要 ... 
- [Python]实现XMPP协议即时通讯发送消息功能
			#-*- coding: utf-8 -*- __author__ = 'tsbc' import xmpp import time #注意帐号信息,必须加@域名格式 from_user = 'che ... 
- css回忆(一)
			1.css的引入方式: a) 在head部分加入<link rel="stylesheet" type="text/css" href="my ... 
- [问题2015S05] 复旦高等代数 II(14级)每周一题(第六教学周)
			[问题2015S05] 设 \(A\) 是 \(n\) 阶复方阵, 证明: \(A\) 可对角化的充分必要条件是 \(A\) 相似于某个如下的循环矩阵: \[C=\begin{pmatrix} a_ ... 
- MySQL安装(转)
			本文介绍MySQL的安装 可以单独阅读,也可以作为PHP环境搭建的一部分 PHP完整配置信息请参考 http://www.cnblogs.com/azhe-style/articles/php_env ... 
- html5 drag and drop
			注:链接.图片默认是draggable的. mousemove在整个拖放的过程中不会被触发. dragStart设置: e.dataTransfer.effectAllowed = "mov ... 
- linux chomd 学习
			chomd -R 777 directory_name :递归地给directory目录下所有文件和子目录的属主分配读的权限 ------2016-10-31 -- source: Linux chm ... 
- redis 不能持久化问题 MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk.
			转载自:http://www.cnblogs.com/anny-1980/p/4582674.html kombu.exceptions.OperationalError: MISCONF Redis ... 
- Android之打log
			Android之打log 1.在代码中加上自己的log 2,模块编译mm -B或者./mk mm/mmm packages/apps/Contacts/ 3编译成功后install或者push生成的a ... 
