title: Oracle Sql query to return the column result in single row
body: <p>I have below select query:</p>
  
  <pre><code>select distinct(e.ENGINE_ID),
         e.ENGINE_NAME,
         os.OBJECT_STATUS,
         br.NAME,
         env.NAME
  from ENGINE e,
       RATOR_MONITORING.OBJECT_STATUS os,
       BRAND_ENGINE be,
       ENVIRONMENT env,
       BRAND br
  where e.ENGINE_ID = os.OBJECT_ID
    AND os.OBJECT_TYPE='ENGINE'
    AND be.ENGINE_ID = e.ENGINE_ID
    AND be.BRAND_ID = br.BRAND_ID 
    AND br.ENV_ID = env.ENV_ID  
  order by decode(os.OBJECT_STATUS, 'R',1, 'Y', 2, 'G', 3, 'N',4) asc,
           UPPER(e.ENGINE_NAME) asc
  </code></pre>
  
  <p>The above query return the result as:</p>
  
  <p><a href="https://i.stack.imgur.com/AR4oH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AR4oH.png" alt="enter image description here"></a></p>
  
  <p>As you can see its returning the duplicate <code>Engine_ID</code> with same <code>ENGINE_NAME,OBJECT_STATUS,NAME_1</code> and the <code>NAME</code> column has different result for the same <code>ENGINE_ID</code>. So i want to return the result for such records in single row. For example as mentioned below:</p>
  
  <pre><code>ENGINE_ID  ENGINE_NAME   OBJECT_STATUS  NAME      NAME_1
  39         ORDER_ENGINE  G              NC,LIDL   FONIC
  </code></pre>