问题描述:

I want to do the following in LINQ to SQL:

 Select count(*) as count_1,

(select count(*) from tableName2) as count_2 FROM tableName

Where x = y

The result should be

Column 1 | column 2

--------------------

50 34

网友答案:

What you need to do is something like this:

select 
  (select count(*) 
   from tableName
   where x = y) as count_1, 
  (select count(*) 
   from tableName2) as count_2
相关阅读:
Top