insert into Resume(userId,userName,companyId,link,gender,birthday,dutyLevel,deptId,deptName,stationId,stationName) 
Select 
a.userId as userId ,
a.firstName+a.lastName as userName,
a.companyId as companyId,
a.emailAddress, 
e.male as gender,
e.birthday as birthday,
e.securityLevel as dutyLevel,
org.organizationId as deptId,
org.name as deptName,
St.Soid As Stationid,
St.Stationname As Stationname from 
User_ as a 
inner join 
Contact_ as e
on 
e.contactId = a.contactId
left join
StationOrg as st 
on
e.prefixid = st.soId
left join 
Users_Orgs as uorg
on
uorg.userId = a.userId
left join 
Organization_ as org
on
org.organizationId=uorg.organizationId
where  
   a.userId <>2 
   and 
   a.userId <>5 把这个sql server中的语句改成oracle版本的 该怎么写

解决方案 »

  1.   

    把表的别名前的AS去掉,INSERT
    INTO Resume
      (
        userId,
        userName,
        companyId,
        LINK,
        gender,
        birthday,
        dutyLevel,
        deptId,
        deptName,
        stationId,
        stationName
      )
    SELECT a.userId          AS userId ,
      a.firstName+a.lastName AS userName,
      a.companyId            AS companyId,
      a.emailAddress,
      e.male             AS gender,
      e.birthday         AS birthday,
      e.securityLevel    AS dutyLevel,
      org.organizationId AS deptId,
      org.name           AS deptName,
      St.Soid            AS Stationid,
      St.Stationname     AS Stationname
    FROM User_ a
    INNER JOIN Contact_ e
    ON e.contactId = a.contactId
    LEFT JOIN StationOrg st
    ON e.prefixid = st.soId
    LEFT JOIN Users_Orgs uorg
    ON uorg.userId = a.userId
    LEFT JOIN Organization_ org
    ON org.organizationId=uorg.organizationId
    WHERE a.userId      <>2
    AND a.userId        <>5