title: SQL Server Codeigniter - How to use the current row&column value as the parameter in the other column?
body: <p>i have some trouble in my SQL database queries.</p>
  
  <p>Assume I have 2 queries, query 1, and query 2</p>
  
  <p>Query 1 result is :</p>
  
  <pre><code>ID      Name
  1       Soap
  2       Spoon
  3       Fork
  4       Toothpaste
  </code></pre>
  
  <p>In the query 2 I need to get the ID from query 1 to get the price, so the result in the third column is dependent with the ID/first column</p>
  
  <pre><code>ID      Name       Price
  1       Soap       10000
  2       Spoon      20000
  3       Fork       30000
  4       Toothpaste 40000
  </code></pre>
  
  <p>My query :</p>
  
  <pre><code>SELECT t.ID, s.NAME FROM TRANSACTION t, STOCK s WHERE s.ID=t.ID
  </code></pre>
  
  <p>and I wanna change that query like this</p>
  
  <pre><code>SELECT t.ID, s.NAME, ????? FROM TRANSACTION t, STOCK s WHERE s.ID=t.ID
  </code></pre>