---
title: "查询的问题"
author: "timewind"
date: "2014-09-29T17:57:00Z"
tags: []
categories: ["数据库"]
slug: "untitled"
draft: false
lastmod: "2014-11-16T21:28:51Z"
id: 2154308
url: "https://timewind.iteye.com/blog/2154308"
---

SELECT OID asoid,

ACCIDENT\_NAME asaccidentName,

ACCIDENT\_TIME as accidentTime,

ACCIDENT\_TYPE as accidentType,

DEATHS as deaths,

MINOR\_INJURIES as minorInjuries,

DIRCT\_FINANCIAL\_LOSS as dirctFinancialLoss,

PROCESSING\_RESULTS as processingResults,

(select Dept\_Name from SYS\_ORGANIZATIONAL a

where to\_char(a.OID) =UNITNAME) AS unitName,

(select Dept\_Name from SYS\_ORGANIZATIONAL a

whereto\_char(a.OID)=ACCIDENT\_REPORT\_UNIT) AS accidentReportUnit,

(select EMPLOYEE\_NAME from SYS\_EMPLOYEE a

where to\_char(a.OID) =CREATETOR) AS creator

fromPMI\_SAFE\_ACCIDENT

一直不能运行成功，找到原因：oid设置成char类型