select s.sex as sex, if(s.sex = 0, '女', '男') as sexText, s.political as political, dd.dict_value as politicalText, s.certificate as certificate, dd1.dict_value as certificateText, s.household as household, dd2.dict_value as householdText, s.pay_type as payType, dd3.dict_value as payTypeText, s.enroll_mode as enrollMode, dd4.dict_value as enrollModeText, s.admission_batch as admissionBatch, dd5.dict_value as admissionBatchTypeText, s.cultivation_level as cultivationLevel, dd6.dict_value as cultivationLevelText, s.cultivation_mode as cultivationMode, dd7.dict_value as cultivationModeText, s.learning_type as learningType, dd8.dict_value as learningTypeText, s.subject as subject, dd9.dict_value as subjectText, dd.is_del as is_del, dd.status as status from student as s left join data_dictionary as dd on s.political = dd.id left join data_dictionary as dd1 on s.certificate = dd1.id left join data_dictionary as dd2 on s.household = dd2.id left join data_dictionary as dd3 on s.pay_type = dd3.id left join data_dictionary as dd4 on s.enroll_mode = dd4.id left join data_dictionary as dd5 on s.admission_batch = dd5.id left join data_dictionary as dd6 on s.cultivation_level = dd6.id left join data_dictionary as dd7 on s.cultivation_mode = dd7.id left join data_dictionary as dd8 on s.learning_type = dd8.id left join data_dictionary as dd9 on s.subject = dd9.id where 1 = 1 and dd9.is_del = 1 and dd9.status = 1 and dd8.is_del = 1 and dd8.status = 1 and dd7.is_del = 1 and dd7.status = 1 and dd6.is_del = 1 and dd6.status = 1 and dd5.is_del = 1 and dd5.status = 1 and dd4.is_del = 1 and dd4.status = 1 and dd3.is_del = 1 and dd3.status = 1 and dd2.is_del = 1 and dd2.status = 1 and dd1.is_del = 1 and dd1.status = 1 and dd.is_del = 1 and dd.status = 1
时间: 2024-04-27 14:25:30 浏览: 197
这是一个 SQL 查询语句,用于查询学生信息表(student)中的各个字段,并通过左连接查询各个字段对应的字典表(data_dictionary)中的对应值。其中,查询的字段包括性别、政治面貌、证件类型、户籍类型、缴费类型、入学方式、录取批次、培养层次、培养方式、学习类型、专业等,并将对应的字典值查询出来。同时,WHERE 子句中包括了一系列过滤条件,用于限定查询结果的范围。
阅读全文