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语句的常用总结(重要)的更多相关文章

  1. 浅谈MySQL中优化sql语句查询常用的30种方法 - 转载

    浅谈MySQL中优化sql语句查询常用的30种方法 1.对查询进行优化,应尽量避免全表扫描,首先应考虑在 where 及 order by 涉及的列上建立索引. 2.应尽量避免在 where 子句中使 ...

  2. Mybatis 动态Sql语句《常用》

    MyBatis 的强大特性之一便是它的动态 SQL.如果你有使用 JDBC 或其他类似框架的经验,你就能体会到根据不同条件拼接 SQL 语句有多么痛苦.拼接的时候要确保不能忘了必要的空格,还要注意省掉 ...

  3. mysql中sql语句的常用语句

    1:提取公共的sql语句: 2:动态添加----sql语句: 代码: <insert id="test1" parameterType="com.floor.sho ...

  4. MySQL中优化sql语句查询常用的30种方法

      1.对查询进行优化,应尽量避免全表扫描,首先应考虑在 where 及 order by 涉及的列上建立索引. 2.应尽量避免在 where 子句中使用!=或<>操作符,否则将引擎放弃使 ...

  5. MySQL中优化sql语句查询常用的种方法

    1.对查询进行优化,应尽量避免全表扫描,首先应考虑在 where 及 order by 涉及的列上建立索引. 2.应尽量避免在 where 子句中使用!=或<>操作符,否则将引擎放弃使用索 ...

  6. 浅谈MySQL中优化sql语句查询常用的30种方法

    1.对查询进行优化,应尽量避免全表扫描,首先应考虑在 where 及 order by 涉及的列上建立索引. 2.应尽量避免在 where 子句中使用!=或<>操作符,否则将引擎放弃使用索 ...

  7. Mysql 性能优化7【重要】sql语句的优化 浅谈MySQL中优化sql语句查询常用的30种方法(转)

    原文链接   http://www.jb51.net/article/39221.htm 这篇文章大家都在转载,估计写的有条理吧,本人稍微做一下补充 1.对查询进行优化,应尽量避免全表扫描,首先应考虑 ...

  8. mysql补充(3)优化sql语句查询常用的30种方法

    1.对查询进行优化,应尽量避免全表扫描,首先应考虑在 where 及 order by 涉及的列上建立索引. 2.应尽量避免在 where 子句中使用!=或<>操作符,否则将引擎放弃使用索 ...

  9. 浅谈 MySQL 中优化 SQL 语句查询常用的 30 种方法

    1.对查询进行优化,应尽量避免全表扫描,首先应考虑在 where 及 order by 涉及的列上建立索引. 2.应尽量避免在 where 子句中使用!=或<>操作符,否则将引擎放弃使用索 ...

随机推荐

  1. ace_admin_1.3.1 wysiwyg 工具条下拉出不来

    试了很久才知道是因为<script src="__PUBLIC__/assets/js/bootstrap.min.js"></script>  这个js加 ...

  2. [像黑客一样生活] shell终端听音乐之网易云shell版

    这是一个Python程序,使用Python构建,并以mpg123作为后端.Follow me... 特点: Vim 式的流畅操作,支持快捷键绑定 支持电台.收藏等各种特色功能 支持 OS X 及各类 ...

  3. 一键式Spring集成工具 Spring Boot

    最近公司使用Spring boot进行开发,稍微了解一下,不过自我感觉把集中式配置applicate.properties搞明白,注解用过Spring MVC的boot绝对没问题的 比如拦截器:@As ...

  4. jquery mobile 和phonegap开发总结之三跨域加载页面

    跨域加载 一要进行一定的配置见下面 $( document ).bind( "mobileinit", function() { // Make your jQuery Mobil ...

  5. iOS - Mac OS X 终端命令

    Mac OS X 终端命令 1)显示当前目录的路径 pwd 2)列出文件 ls 参数 目录名 参数: -w 显示中文,-l 详细信息, -a 包括隐藏文件,每一行开头是 "d" 则 ...

  6. linux下查看某软件是否已安装, ubuntu安装deb包

    1.rpm包安装的,可以用rpm -qa看到,如果要查找某软件包是否安装,用 rpm -qa | grep “软件或者包的名字”. [root@hexuweb102 ~] rpm -qa | grep ...

  7. 【转载】CSS规范

    原文地址:http://www.cnblogs.com/whitewolf/p/4491707.html 目录 HTML 语法 HTML5 doctype 语言属性(Language attribut ...

  8. for_each使用方法详解[转]

    for_each使用方法详解[转] Abstract之前在(原創) 如何使用for_each() algorithm? (C/C++) (STL)曾經討論過for_each(),不過當時功力尚淺,只談 ...

  9. php null o false ''

    php中很多还不懂php中0,"",null和false之间的区别,这些区别有时会影响到数据判断的正确性和安全性,给程序的测试运行造成很多麻烦.先看一个例子: <? $str ...

  10. Mybatis 开启事务@Transactional