Need to convert this SQL to linq -


i've got sql, need convert linq query. having difficulty trying use partition/rownum , patition/count together.

select top 1 vals.c3, (vals.rank * vals.[occurances]) rnk ( select row_number() over(order c1 asc) rank, count(*) over(partition c3) [occurances], c3 dbo.ranks c2 in ('adams', 'chip', 'shop') group  c3,c2,c1 ) vals --group vals.c3 order rnk desc 

this ranks list like:

c1      c2      c3 26774   chip     chipshop 26054   shop     shops 10054   shop     chipshop 23037   medical  doctors 21434   centre   doctors 12803   dental   dentists 11847   office   post offices 

c2 word, c3 category i'm looking for. c1 how word occurs per category. when enter search 'adams chip shop', it'll go , find category match based on name.

any appreciated :)

try tool. want.

linqer


Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -