51Testing软件测试论坛

标题: oracle查询语句报标识符无效 [打印本页]

作者: 测试积点老人    时间: 2020-2-17 10:57
标题: oracle查询语句报标识符无效
oracle查询语句报标识符无效
下面这个语句在
  1. select BLDD from(select BLDD,YWDJRQ from POP_MARRIAGE where (ZFID=t.RKBSID or qzid =t.RKBSID) order by YWDJRQ desc)where rownum =1)as
  2. P_CREATE_DIVISION  
  3. 这个地方报t.RKBSID标识符无效,请问下我的sql是哪里有问题呢?POP_PERSON表是有RKBSID这个字段的。
  4. SQL全文如下:
  5. select
  6. t.RKBSID as GUID,
  7. t.XM as PERSON_NAME,
  8. t.XB as GENDER,
  9. t1.JKZK as HEALTH_STATE,
  10. t.ZJLX as IDENTITY_TYPE,
  11. t.ZJHM as IDENTITY_NUMBER,
  12. t.CSRQ as BIRTHDAY,
  13. t.MZ as ETHNIC_GROUP,
  14. t.WHCD as EDUCATION_LEVEL,
  15. t.GJ as NATIONALITY,
  16. t.ZZMM as POLITICAL_LANDSCAPE,
  17. t1.DSZNFMGRZBH as GLORIOUS_PERMIT_NUMBER,
  18. t.SFDS as ONLY_CHILD,
  19. t.LXDH as CONTACT_NUMBER,
  20. t.ZY as EMPLOYMENT_STATUS,
  21. t.GZDW as WORK_UNIT,
  22. t.HYZK as MARITAL_STATUS,
  23. t.HYBDRQ as CHANGE_DATE,
  24. t.POBSID as P_GUID,
  25. t.POXM as P_PERSON_NAME,
  26. t.POGMSFHM as P_IDENTITY_NUMBER,
  27. t.XJZD as LIVING_DIVISION,
  28. t.XJZDXZ as LIVING_ADDRESS,
  29. t.HJDXZ as HOUSEHOLD_ADDRESS,
  30. t.SFBJQC as MARK_MOVE_OUT,
  31. t.SFBJLK as MARK_MOVE_EXIT,
  32. t.GDSJSFWZZJHM as PROVINCIAL_CERT_NUMBER,
  33. t.GDSJSFWZLZRQ as PROVINCIAL_CERT_ISSUE_DATE,
  34. t.LRBDRQ as MOVE_IN_DATE,
  35. t.LCBDRQ as MOVE_OUT_DATE,
  36. t.ZXYY as CANCEL_REASON,
  37. t.ZXRQ as CANCEL_DATE,
  38. t.LDZHM as NATIONAL_CERT_NUMBER,
  39. t.LLDZRQ as NATIONAL_CERT_ISSUE_DATE,
  40. t.LDZYXRQ as NATIONAL_CERT_EFFECTIVE_DATE,
  41. t.JKRQ as move_CREATE_TIME,
  42. t.JKR as move_CREATE_USER,
  43. t.GXRQ as LAST_UPDATE_TIME,
  44. (select xm from POP_PERSON where rkbsid=t1.QSMQBSID)as M_PERSON_NAME,
  45. (select xm from POP_PERSON where rkbsid=t1.QSFQBSID)as F_PERSON_NAME,
  46. (select CSRQ from POP_PERSON where rkbsid=t1.QSMQBSID)as M_BIRTHDAY,
  47. (select CSRQ from POP_PERSON where rkbsid=t1.QSFQBSID)as F_BIRTHDAY,
  48. (select ZJHM from POP_PERSON where rkbsid=t1.QSMQBSID)as M_IDENTITY_NUMBER,
  49. (select ZJHM from POP_PERSON where rkbsid=t1.QSFQBSID)as F_IDENTITY_NUMBER,
  50. t1.YWDJR as CREATE_DIVISION,
  51. t1.YWGXRQ as CREATE_TIME,
  52. t1.YWGXR as CREATE_USER,
  53. (select CSRQ from POP_PERSON where rkbsid=t.POBSID)as P_BIRTHDAY,
  54. (select  HYZK from POP_PERSON where rkbsid=t.POBSID)as P_MARITAL_STATUS,
  55. (select  HYBDRQ from POP_PERSON where rkbsid=t.POBSID)as P_CHANGE_DATE,
  56. (select BLDD from(select  BLDD,YWDJRQ from POP_MARRIAGE where (ZFID=t.RKBSID or qzid =t.RKBSID) order by YWDJRQ desc)where rownum =1)as
  57. P_CREATE_DIVISION,
  58. (select  max(YWDJRQ) from POP_MARRIAGE where ZFID=t.RKBSID or qzid =t.RKBSID)as
  59. P_CREATE_TIME,
  60. (select YWDJR from(select  YWDJR,YWDJRQ from POP_MARRIAGE where ZFID=t.RKBSID or qzid =t.RKBSID  order by YWDJRQ desc)where rownum =1)as
  61. P_CREATE_USER
  62. from  POP_PERSON t left join  POP_CHILDREN t1 on t.RKBSID=t1.WYBS;
复制代码



作者: bellas    时间: 2020-2-18 10:27
可能是因为你的SQL中列名写错了,
作者: jingzizx    时间: 2020-2-18 13:51
字段是否有问题




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2