title: How to simulate Derived table with linq to Entities
body: <p>How I can simulate <code>Derived Table</code> with linq?</p>
  
  <p>Consider this Code:</p>
  
  <pre><code>SELECT * FROM (SELECT * FROM Mytbl) AS tmp WHERE tmp.ID=1
  </code></pre>
  
  <p>How I can write this with Linq ?</p>
  
  <p>thanks</p>
  
  <p><strong>EDIT 1:</strong></p>
  
  <p>How to convert this to linq?:</p>
  
  <pre><code>select 
  convert( decimal(10,1), ROUND(A.c2*100,8)),
  convert( decimal(10,1), ROUND(A.c3*100,8))
  from
  (
  SELECT 
      (
          SELECT CONVERT(INT, COUNT(ID))
          FROM tbl
          WHERE (col06 &gt;= @param_Min and col06 &lt;= @param_Max )
  
      )
      /  
      (
          SELECT CONVERT(INT, COUNT(ID))
          FROM tbl
          WHERE (col06 &gt;= 10 )                    
      ) as c2
      (
          SELECT CONVERT(INT, COUNT(ID))
          FROM tbl
          WHERE (col06 &gt;= @param_Min and col06 &lt;= @param_Max )
              AND (col03 = 1)
      )
      /  
      (
          SELECT CONVERT(INT, COUNT(ID))
          FROM tbl
          WHERE (col06 &gt;= 10 ) AND (col03 = 1)    
      ) as c3
  ) AS A
  </code></pre>