本文介绍了表PIVOT INEER在SQL中加入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 嗨朋友 紧急 我的问题是...... 我有两张桌子 第一张表是na P is /> ==== =========================== id PARENTID ITEM 1 NULL员工人数 2 1 UNEMPLOYPERSON 3 1 MALEUNEMPLOY 4 1 FEMALEUNEMPLOY 5 NULL员工 6 1 UNEMPLOYPERSON 7 1 MALEUNEMPLOY 8 1 FEMALEUNEMPLOY ================================ ================================== 第二张表是PV ============================= ======== id PID VALUE 1 1 20 2 2 45 3 3 5 4 4 12 === ============================== 其中PID是P表ID 和最后一张桌子是TP ============================= ========= ID PID NAME PrentID 1 1 COUNTRY null 2 1 STATE 1 3 1 CITY 2 4 2 COUNTRY null 5 2 STATE 1 6 2 CITY 2 =============================== === 其中pid是P表ID 如何显示这个...... br $> IN CITY TOTALPERSON ENEMPLOYPERSON雇员MALEUNEMPLOY 82 45 20 5 IN STATE TOTALPERSON ENEMPLOYPERSON雇员MALEUNEMPLOY 82 45 20 5 这不是静态的d ynamic取决于所选择的区域...国家,州,城市 解决方案 Hi FriendsMy problem is...I have two tableFirst table naem is P===============================idPARENTIDITEM1NULL EMPLOYE PERSON21 UNEMPLOYPERSON31 MALEUNEMPLOY4 1 FEMALEUNEMPLOY5NULL EMPLOYE PERSON61 UNEMPLOYPERSON71 MALEUNEMPLOY8 1 FEMALEUNEMPLOY==================================================================Second table is PV=====================================idPIDVALUE112022453354412=================================where PID is P Table IDAnd the last table is TP======================================ID PID NAME PrentID1 1 COUNTRY null2 1 STATE 13 1 CITY 24 2 COUNTRY null5 2 STATE 16 2 CITY 2==================================where pid is P Table IDHow can I display this like ...IN CITYTOTALPERSON ENEMPLOYPERSON EMPLOYPERSON MALEUNEMPLOY82 45 20 5IN STATETOTALPERSON ENEMPLOYPERSON EMPLOYPERSON MALEUNEMPLOY82 45 20 5This is not static it is dynamic depending on area selected like ...COUNTRY,STATE,CITY[Edit - CHill60 SHOUTING removed] 解决方案 这篇关于表PIVOT INEER在SQL中加入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 09-06 03:41