Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6675373
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:50:51+00:00 2026-05-26T03:50:51+00:00

I have a member table with columns member_id member_lastname member_firstname i have another table

  • 0

I have a member table with columns

 member_id
 member_lastname
 member_firstname

i have another table visits with columns

visit_id
member_id
visit_date

i have got the mysql query like this

string sql =  @"SELECT COUNT('x') AS numVisits, member_firstname as firstname, member_lastname as lastname, members.member_id
                FROM visits, members
                WHERE visits.member_id = members.member_id
                 AND visit_Date BETWEEN @startdate AND @enddate
                GROUP BY member_firstname, member_lastname, members.member_id
                ORDER BY COUNT('x') DESC";

How can i convert this query into linq to entities

my entity name is trasitdbcontext

would any one pls give any idea about this ..

Many thanks…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T03:50:52+00:00Added an answer on May 26, 2026 at 3:50 am
    from v in visits
    join m in members on v.member_id equals m.member_id
    where v.visit_Date >= startDate && v.visit_Date <= endDate
    group m by new {  m.member_firstname, m.member_lastname, m.member_id } into g
    orderby g.Count()
    select new
    {
       count = g.Count(),
       member_firstname = g.Key.member_firstname, 
       member_lastname = = g.Key.member_lastname,
       member_id = = g.Key.member_id,
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a visit table with columns member_id visit_id visit_logout_datetime(values like this... ' now
I have a members table with columns member_Id, member_Lastname, member_Firstname, member_Postcode, member_Reference, member_CardNum, and
I have a table called visit with the following columns: visit_Id member_Id visit_Date visit_Time
I have member table member_Id Last name first name postcode reference another table memberstomships
I have a member Table with member_Id a mmship table with columns mmshipstart date
I have a table of member-to-member connections. The schema is member_id, friend_id, is_active. I
I have two MySQL tables A and B . Table A has a member
In my MySQL table I have a column named member_id . That column stores
I have a custom DataContext with a Table member... Entry is defined as... [Table(Name=Entry)]
I have 2 tables: shares and pending_share_changes. The shares table has the following columns:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.