最牛X的SQL语句

SELECT top 1 ooo.ooo_title,cv.apply_id,cv.apply_date,xxx_basic_info1.name,isnull((SELECT top 1 code_cn_value FROM code_value WHERE code_id=40818 and value=xxx_basic_info1.gender),''),xxx_basic_info1.birthday,isnull((SELECT top 1 code_cn_value FROM code_value WHERE code_id=40820 and value=xxx_basic_info1.marital),''),isnull((SELECT top 1 a.code_cn_value FROM code_value a INNER JOIN xxx_value_cust b ON a.value=b.value WHERE a.code_id=40899 and b.cust_id=5569 and b.repeat_id=1 and b.xxx_id=143011050509001379),''),xxx_basic_info1.id_card,xxx_basic_info1.passport,isnull((SELECT top 1 code_cn_value FROM code_value WHERE code_id=40824 and value=xxx_basic_info1.graduate_date),''),isnull((SELECT top 1 a.code_cn_value FROM code_value a INNER JOIN xxx_value_cust b ON a.value=b.value WHERE a.code_id=40900 and b.cust_id=5573 and b.repeat_id=1 and b.xxx_id=143011050509001379),''),xxx_basic_info1.work_date,isnull((SELECT top 1 code_cn_value FROM code_value WHERE code_id=40830 and value=xxx_basic_info1.pr_city_id),''),xxx_basic_info1.pr_oth_city,isnull((SELECT top 1 code_cn_value FROM code_value WHERE code_id=40832 and value=xxx_basic_info1.cur_city_id),''),xxx_basic_info1.cur_oth_city,xxx_basic_info1.exp_city,isnull((SELECT top 1 a.code_cn_value FROM code_value a INNER JOIN xxx_value_cust b ON a.value=b.value WHERE a.code_id=40901 and b.cust_id=5580 and b.repeat_id=1 and b.xxx_id=143011050509001379),''),xxx_basic_info1.dorm_tel,xxx_basic_info1.tel,xxx_basic_info1.mobile,xxx_basic_info1.pager,xxx_basic_info1.email,xxx_basic_info1.address,xxx_basic_info1.postcode,isnull((SELECT top 1 a.code_cn_value FROM code_value a INNER JOIN xxx_value_cust b ON a.value=b.value WHERE a.code_id=40902 and b.cust_id=5588 and b.repeat_id=1 and b.xxx_id=143011050509001379),''),xxx_basic_info1.xxx_intro,isnull((SELECT top 1 value FROM xxx_value_cust WHERE cust_id=5590 and repeat_id=1 and xxx_id=143011050509001379),''),xxx_basic_info1.upload_cv,xxx_degree_info1.start_date,xxx_degree_info1.end_date,isnull((SELECT top 1 code_cn_value FROM code_value WHERE code_id=40847 and value=xxx_degree_info1.school_id),''),xxx_degree_info1.oth_school,isnull((SELECT top 1 code_cn_value FROM code_value WHERE code_id=40849 and value=xxx_degree_info1.faculty),''),xxx_degree_info1.major,isnull((SELECT top 1 code_cn_value FROM code_value WHERE code_id=40851 and value=xxx_degree_info1.degree),''),isnull((SELECT top 1 code_cn_value FROM code_value WHERE code_id=40852 and value=xxx_degree_info1.gpa),''),xxx_degree_info1.courses,xxx_degree_info2.start_date,xxx_degree_info2.end_date,isnull((SELECT top 1 code_cn_value FROM code_value WHERE code_id=40847 and value=xxx_degree_info2.school_id),''),xxx_degree_info2.oth_school,isnull((SELECT top 1 code_cn_value FROM code_value WHERE code_id=40849 and value=xxx_degree_info2.faculty),''),xxx_degree_info2.major,isnull((SELECT top 1 code_cn_value FROM code_value WHERE code_id=40851 and value=xxx_degree_info2.degree),''),isnull((SELECT top 1 code_cn_value FROM code_value WHERE code_id=40852 and value=xxx_degree_info2.gpa),''),xxx_degree_info2.courses,xxx_degree_info3.start_date,xxx_degree_info3.end_date,isnull((SELECT top 1 code_cn_value FROM code_value WHERE code_id=40847 and value=xxx_degree_info3.school_id),''),xxx_degree_info3.oth_school,isnull((SELECT top 1 code_cn_value FROM code_value WHERE code_id=40849 and value=xxx_degree_info3.faculty),''),xxx_degree_info3.major,isnull((SELECT top 1 code_cn_value FROM code_value WHERE code_id=40851 and value=xxx_degree_info3.degree),''),isnull((SELECT top 1 code_cn_value FROM code_value WHERE code_id=40852 and value=xxx_degree_info3.gpa),''),xxx_degree_info3.courses,isnull((SELECT top 1 a.code_cn_value FROM code_value a INNER JOIN xxx_value_cust b ON a.value=b.value WHERE a.code_id=40903 and b.cust_id=5130 and b.repeat_id=1 and b.xxx_id=143011050509001379),''),xxx_edu_info1.award,xxx_edu_info1.activity,isnull((SELECT top 1 code_cn_value FROM code_value WHERE code_id=40859 and value=xxx_skill_info1.eng_cert),''),isnull((SELECT top 1 code_cn_value FROM code_value WHERE code_id=40860 and value=xxx_skill_info1.pass_st),''),xxx_skill_info1.tofel,xxx_skill_info1.gre,xxx_skill_info1.gmat,isnull((SELECT top 1 code_cn_value FROM code_value WHERE code_id=40864 and value=xxx_skill_info1.oral_lv),''),isnull((SELECT top 1 code_cn_value FROM code_value WHERE code_id=40865 and value=xxx_skill_info1.oth_lang),''),xxx_skill_info1.oth_lang_lv,isnull((SELECT top 1 code_cn_value FROM code_value WHERE code_id=40867 and value=xxx_skill_info1.dialect),''),isnull((SELECT top 1 code_cn_value FROM code_value WHERE code_id=40868 and value=xxx_skill_info1.dialect_lv),''),isnull((SELECT top 1 a.code_cn_value FROM code_value a INNER JOIN xxx_value_cust b ON a.value=b.value WHERE a.code_id=40904 and b.cust_id=5143 and b.repeat_id=1 and b.xxx_id=143011050509001379),''),isnull((SELECT top 1 value FROM xxx_value_cust WHERE cust_id=5144 and repeat_id=1 and xxx_id=143011050509001379),''),xxx_skill_info1.oth_certificate,xxx_skill_info1.computer_lang,xxx_skill_info1.oth_skill,xxx_skill_info1.hobby,xxx_project_info1.start_date,isnull((SELECT top 1 value FROM xxx_value_cust WHERE cust_id=5518 and repeat_id=1 and xxx_id=143011050509001379),''),xxx_project_info1.project_name,xxx_project_info1.project_duty,xxx_project_info1.project_desc,xxx_project_info2.start_date,isnull((SELECT top 1 value FROM xxx_value_cust WHERE cust_id=5523 and repeat_id=2 and xxx_id=143011050509001379),''),xxx_project_info2.project_name,xxx_project_info2.project_duty,xxx_project_info2.project_desc,xxx_project_info3.start_date,isnull((SELECT top 1 value FROM xxx_value_cust WHERE cust_id=5528 and repeat_id=3 and xxx_id=143011050509001379),''),xxx_project_info3.project_name,xxx_project_info3.project_duty,xxx_project_info3.project_desc,xxx_project_info4.start_date,isnull((SELECT top 1 value FROM xxx_value_cust WHERE cust_id=5533 and repeat_id=4 and xxx_id=143011050509001379),''),xxx_project_info4.project_name,xxx_project_info4.project_duty,xxx_project_info4.project_desc,xxx_exp_info1.start_date,isnull((SELECT top 1 value FROM xxx_value_cust WHERE cust_id=5538 and repeat_id=1 and xxx_id=143011050509001379),''),xxx_exp_info1.company_name,xxx_exp_info1.ooo_title,isnull((SELECT top 1 code_cn_value FROM code_value WHERE code_id=40885 and value=xxx_exp_info1.ooo_type),''),xxx_exp_info1.reason,xxx_exp_info1.ooo_duty,xxx_exp_info2.start_date,isnull((SELECT top 1 value FROM xxx_value_cust WHERE cust_id=5545 and repeat_id=2 and xxx_id=143011050509001379),''),xxx_exp_info2.company_name,xxx_exp_info2.ooo_title,isnull((SELECT top 1 code_cn_value FROM code_value WHERE code_id=40885 and value=xxx_exp_info2.ooo_type),''),xxx_exp_info2.reason,xxx_exp_info2.ooo_duty,xxx_exp_info3.start_date,isnull((SELECT top 1 value FROM xxx_value_cust WHERE cust_id=5552 and repeat_id=3 and xxx_id=143011050509001379),''),xxx_exp_info3.company_name,xxx_exp_info3.ooo_title,isnull((SELECT top 1 code_cn_value FROM code_value WHERE code_id=40885 and value=xxx_exp_info3.ooo_type),''),xxx_exp_info3.reason,xxx_exp_info3.ooo_duty,xxx_exp_info4.start_date,isnull((SELECT top 1 value FROM xxx_value_cust WHERE cust_id=5559 and repeat_id=4 and xxx_id=143011050509001379),''),xxx_exp_info4.company_name,xxx_exp_info4.ooo_title,isnull((SELECT top 1 code_cn_value FROM code_value WHERE code_id=40885 and value=xxx_exp_info4.ooo_type),''),xxx_exp_info4.reason,xxx_exp_info4.ooo_duty,xxx_refer_info1.name,xxx_refer_info1.relationship,xxx_refer_info1.company,xxx_refer_info1.tel,xxx_refer_info2.name,xxx_refer_info2.relationship,xxx_refer_info2.company,xxx_refer_info2.tel,ibm_question11.question1,ibm_question11.question2,ibm_question11.question3,ibm_question21.question1,ibm_question21.question2,ibm_question21.question3,ibm_question21.question4,ibm_question21.question5 FROM xxx_info cv INNER JOIN ooo_info ooo ON cv.ooo_id=ooo.ooo_id LEFT OUTER JOIN xxx_basic_info xxx_basic_info1 ON cv.xxx_id=xxx_basic_info1.xxx_id and xxx_basic_info1.repeat_id=1 LEFT OUTER JOIN xxx_degree_info xxx_degree_info1 ON cv.xxx_id=xxx_degree_info1.xxx_id and xxx_degree_info1.repeat_id=1 LEFT OUTER JOIN xxx_degree_info xxx_degree_info2 ON cv.xxx_id=xxx_degree_info2.xxx_id and xxx_degree_info2.repeat_id=2 LEFT OUTER JOIN xxx_degree_info xxx_degree_info3 ON cv.xxx_id=xxx_degree_info3.xxx_id and xxx_degree_info3.repeat_id=3 LEFT OUTER JOIN xxx_edu_info xxx_edu_info1 ON cv.xxx_id=xxx_edu_info1.xxx_id and xxx_edu_info1.repeat_id=1 LEFT OUTER JOIN xxx_skill_info xxx_skill_info1 ON cv.xxx_id=xxx_skill_info1.xxx_id and xxx_skill_info1.repeat_id=1 LEFT OUTER JOIN xxx_project_info xxx_project_info1 ON cv.xxx_id=xxx_project_info1.xxx_id and xxx_project_info1.repeat_id=1 LEFT OUTER JOIN xxx_project_info xxx_project_info2 ON cv.xxx_id=xxx_project_info2.xxx_id and xxx_project_info2.repeat_id=2 LEFT OUTER JOIN xxx_project_info xxx_project_info3 ON cv.xxx_id=xxx_project_info3.xxx_id and xxx_project_info3.repeat_id=3 LEFT OUTER JOIN xxx_project_info xxx_project_info4 ON cv.xxx_id=xxx_project_info4.xxx_id and xxx_project_info4.repeat_id=4 LEFT OUTER JOIN xxx_exp_info xxx_exp_info1 ON cv.xxx_id=xxx_exp_info1.xxx_id and xxx_exp_info1.repeat_id=1 LEFT OUTER JOIN xxx_exp_info xxx_exp_info2 ON cv.xxx_id=xxx_exp_info2.xxx_id and xxx_exp_info2.repeat_id=2 LEFT OUTER JOIN xxx_exp_info xxx_exp_info3 ON cv.xxx_id=xxx_exp_info3.xxx_id and xxx_exp_info3.repeat_id=3 LEFT OUTER JOIN xxx_exp_info xxx_exp_info4 ON cv.xxx_id=xxx_exp_info4.xxx_id and xxx_exp_info4.repeat_id=4 LEFT OUTER JOIN xxx_refer_info xxx_refer_info1 ON cv.xxx_id=xxx_refer_info1.xxx_id and xxx_refer_info1.repeat_id=1 LEFT OUTER JOIN xxx_refer_info xxx_refer_info2 ON cv.xxx_id=xxx_refer_info2.xxx_id and xxx_refer_info2.repeat_id=2 LEFT OUTER JOIN ibm_question1 ibm_question11 ON cv.xxx_id=ibm_question11.xxx_id and ibm_question11.repeat_id=1 LEFT OUTER JOIN ibm_question2 ibm_question21 ON cv.xxx_id=ibm_question21.xxx_id and ibm_question21.repeat_id=1 WHERE cv.xxx_id=143011050509001379


 
 
 
 

posted on 2006-01-17 11:25 ffan 阅读(1834) 评论(11)  编辑 收藏 引用 所属分类: DataBase

评论

# re: 最牛X的SQL语句 2006-01-17 14:40 萌芽的叶子

强  回复  更多评论   

# re: 最牛X的SQL语句 2006-02-01 15:13 快乐着飞舞着

头昏 !  回复  更多评论   

# re: 最牛X的SQL语句 2006-02-06 10:02 philip

别人怎么维护  回复  更多评论   

# re: 最牛X的SQL语句 2006-02-09 14:21 ffan

估計是程序循環生成的  回复  更多评论   

# re: 最牛X的SQL语句 2006-02-12 21:54 老猪@八戒

平身见过最强的。  回复  更多评论   

# re: 最牛X的SQL语句 2006-02-21 11:16 垃圾

已不过如此.....  回复  更多评论   

# re: 最牛X的SQL语句 2006-02-21 23:31 WinUU

维护基本靠 Press WinKey+U,U  回复  更多评论   

# re: 最牛X的SQL语句 2006-03-02 11:31 augljyy

就最后一句强`!  回复  更多评论   

# re: 最牛X的SQL语句 2006-03-02 11:32 augljyy

你帖的乱,把人蒙着了`!  回复  更多评论   

# re: 最牛X的SQL语句 2006-04-19 20:28 richardw

最后的WHERE最强了……  回复  更多评论   

# re: 最牛X的SQL语句 2010-11-03 14:51 jackhoo

一般般吧,也不是太强  回复  更多评论   

只有注册用户登录后才能发表评论。
<2006年1月>
25262728293031
1234567
891011121314
15161718192021
22232425262728
2930311234

导航

统计

常用链接

留言簿(11)

随笔分类

随笔档案

相册

搜索

最新评论

阅读排行榜

评论排行榜