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. HTML 事件属性(下)

    HTML 事件属性(下) 一:键盘事件 (Keyboard Events)二:鼠标事件 (Mouse Events) 一:键盘事件 (Keyboard Events)在下列元素中无效:base.bdo ...

  2. 如何阅读《ECMAScript 2015 Language Specification》

    你不需要把<ECMAScript 2015 Language Specification>通读一遍,因为没那个必要.   阮一峰建议: 对于一般用户来说,除了第4章,其他章节都涉及某一方面 ...

  3. linux权限,所有者、所在组、其他组(其他人员),chmod,chown

    用户组 在linux中的每个用户必须属于一个组,不能独立于组外.在linux中每个文件有所有者.所在组.其它组的概念 - 所有者 - 所在组 - 其它组 - 改变用户所在的组 所有者 一般为文件的创建 ...

  4. postgis数据库文件shapefile导入 dbf file (.dbf) can not be opened.shapefile import failed.

    Destination: public.train_polylineSource File: C:\Documents and Settings\Administrator\桌面\ffffff\tra ...

  5. python的class的__str__()和__repr__()函数

    repr(object) 返回一个可以用来表示对象的可打印字符串首先,尝试生成这样一个字符串,将其传给 eval()可重新生成同样的对象 否则,生成用尖括号包住的字符串,包含类型名和额外的信息(比如地 ...

  6. C#_批量插入数据到Sqlserver中的四种方式

    先创建一个用来测试的数据库和表,为了让插入数据更快,表中主键采用的是GUID,表中没有创建任何索引.GUID必然是比自增长要快的,因为你生成一个GUID算法所花的时间肯定比你从数据表中重新查询上一条记 ...

  7. 解决:Unknown table engine 'InnoDB'

        把查询mysql的结果输出到文件的过程中出现了错误 ERROR 1286 (42000): Unknown table engine 'InnoDB'     这个问题的原因是新版mysql是 ...

  8. 解决Jenkins打不开浏览器问题

    参考:http://blog.csdn.net/achang21/article/details/45096003 1.控制面板禁用掉jenkins服务 2.java -jar jenkins.war ...

  9. C#窗体布局方式

    DataGridView:显示数据表后台数据绑定: List<xxx> list = new List<xxx>(); dataGridView1.DataSource = l ...

  10. PHP判断变量是否为整型

    1.使用is_int() 2.使用is_numeric() 两个函数的区别,当变量为'1'时, is_int()的返回值为false, is_numeric()的返回值为true 当变量为1时, 两个 ...