oracle(+)修改为mysql问题

以下是oracle中的语句:
SELECT
c.COLUMN_ID id,
c.TEMPLATE_ID templateId,
c.PARENT_ID pId,
c.COLUMN_NAME columnName,
c.COLUMN_CNAME name,
c.COLUMN_TYPE columnType,
c.COLUMN_URL columnUrl,
c.COLUMN_IMG columnImg,
c.PARAMS_NAME paramsName,
l.COLUMN_CNAME pname,
c.POSITION position,
c.CREATED_BY createdBy,
c.CREATED_DATE createdDate,
c.UPDATED_BY updatedBy,
c.UPDATED_DATE updatedDate,
t.template_cname templateCName,
t.template_name templateName
FROM PRODUCT_CMS_COLUMN c,PRODUCT_CMS_COLUMN l,PRODUCT_CMS_TEMPLATE t
where c.PARENT_ID = l.COLUMN_ID(+) AND c.template_id = t.template_id(+)

  start with c.COLUMN_ID = 'COL160517000016'
  connect by prior c.COLUMN_ID = c.PARENT_ID
  ORDER BY c.POSITION DESC

mysql语句:
SELECT c.COLUMN_ID id,
c.TEMPLATE_ID templateId,
c.PARENT_ID pId,
c.COLUMN_NAME columnName,
c.COLUMN_CNAME name,
c.COLUMN_TYPE columnType,
c.COLUMN_URL columnUrl,
c.COLUMN_IMG columnImg,
c.PARAMS_NAME paramsName,
l.COLUMN_CNAME pname,
c.POSITION position,
c.CREATED_BY createdBy,
c.CREATED_DATE createdDate,
c.UPDATED_BY updatedBy,
c.UPDATED_DATE updatedDate,
t.template_cname templateCName,
t.template_name templateName
FROM(PRODUCT_CMS_COLUMN c LEFT JOIN PRODUCT_CMS_COLUMN l ON c.PARENT_ID = l.COLUMN_ID)
LEFT JOIN PRODUCT_CMS_TEMPLATE t ON c.TEMPLATE_ID = t.TEMPLATE_ID
WHERE FIND_IN_SET(c.COLUMN_ID,PRODUCT_CMS_COLUMN_PARENT_LIST('COL160517000016'))
ORDER BY c.POSITION DESC;

在mysql数据库时报错:[Err] 1054 - Unknown column 'PARENT_ID' in 'field list'

查看全部
lixiaohui6
lixiaohui6
2016/08/29 02:53
  • 点赞
  • 收藏
  • 回答
    私信

3个回复