c# - Combine two counting queries into one Boolean query -
I can not think of a good way to write it as a single question.
Int count1 = query1.Count (); Int count2 = query2.Count (); Return count1 & gt; COUNT2; Please note that I am interested in ways to write a Single query that boolean values and evaluate once upon a server.
Please note that I'm interested in writing methods with LINQ, not with SQL
Try
return query1.count ()> Query2.Count (); The same server is not worth trying to run two unrelated questions in the call, but here it is:
when selecting a case (SELECT COUNT (*) from products) & gt; (Select CADTO) then cast (as 1 bit) ELSE cast (0 AS bit) However, I seriously doubt that you would like LINQ to do this type of The query can be found to create. You must call a stored procedure instead.
Comments
Post a Comment