title: What is wrong with this Oracle query? ( ORA-00904: "DURUM": invalid identifier)
body: <p>I am trying to write an SQL query. If it works in Oracle SQL Developer, I will use it in TableAdapters query. This is the query; DURUM doesn't belong to any table but I will ad it as a field in the TableAdapter</p>
  
  <p>Error is; ORA-00904: "DURUM": invalid identifier</p>
  
  <pre><code>SELECT IPYYB_BELGE.BELGEID,
         IPYYB_MUELLIF.MUELLIFID,
         IPYYB_MUELLIF.AD,
         IPYYB_MUELLIF.SOYAD,
         IPYYB_MUELLIF.TCKIMLIKNO,
         IPYYB_BELGE.SERINO,
         IPYYB_PRM_BELGEGRUP.ACIKLAMA,
         IPYYB_BELGE.ALINMATARIHI,
         IPYYB_BELGE.SONGUNCELLEMETARIHI,
         IPYYB_PRM_MUELLIFUNVAN.ACIKLAMA AS UNVANACIKLAMA,
         DURUM,
         CASE
           WHEN IPYYB_BELGE.ALINMATARIHI &gt;= 2012 THEN 'EDA'
           WHEN IPYYB_BELGE.ALINMATARIHI &lt; 2012 THEN 'GECE'
         END AS DURUM
  FROM IPYYB_MUELLIF,
       IPYYB_BELGE,
       IPYYB_PRM_BELGEGRUP,
       IPYYB_PRM_MUELLIFUNVAN
  WHERE IPYYB_MUELLIF.MUELLIFID = IPYYB_BELGE.MUELLIFID
  AND   IPYYB_BELGE.GRUPID = IPYYB_PRM_BELGEGRUP.KOD
  AND   IPYYB_MUELLIF.UNVAN = IPYYB_PRM_MUELLIFUNVAN.KOD (+)
  </code></pre>
  
  <p>The solution is </p>
  
  <pre><code>SELECT IPYYB_BELGE.BELGEID,
     IPYYB_MUELLIF.MUELLIFID,
     IPYYB_MUELLIF.AD,
     IPYYB_MUELLIF.SOYAD,
     IPYYB_MUELLIF.TCKIMLIKNO,
     IPYYB_BELGE.SERINO,
     IPYYB_PRM_BELGEGRUP.ACIKLAMA,
     IPYYB_BELGE.ALINMATARIHI,
     IPYYB_BELGE.SONGUNCELLEMETARIHI,
     IPYYB_PRM_MUELLIFUNVAN.ACIKLAMA AS UNVANACIKLAMA,
  
     (CASE
       WHEN IPYYB_BELGE.ALINMATARIHI &gt;= 2012 THEN 'EDA'
       WHEN IPYYB_BELGE.ALINMATARIHI &lt; 2012 THEN 'GECE'
     END) DURUM
  FROM IPYYB_MUELLIF,
       IPYYB_BELGE,
       IPYYB_PRM_BELGEGRUP,
       IPYYB_PRM_MUELLIFUNVAN
  WHERE IPYYB_MUELLIF.MUELLIFID = IPYYB_BELGE.MUELLIFID
  AND   IPYYB_BELGE.GRUPID = IPYYB_PRM_BELGEGRUP.KOD
  AND   IPYYB_MUELLIF.UNVAN = IPYYB_PRM_MUELLIFUNVAN.KOD (+)
  </code></pre>