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 8178327
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T23:44:12+00:00 2026-06-06T23:44:12+00:00

This is my MS SQL Query ( I m using this as a Stored

  • 0

This is my MS SQL Query ( I m using this as a Stored Procedure ). I am new to LINQ. I am using .NET framework 4.0 and Entity Framework.

Query 1

 SELECT SUM(PTS.Run1)AS Run1,SUM(PTS.Run2)AS Run2,
 SUM(PTS.Run3)AS Run3,SUM(PTS.Run4)AS Run4,SUM(PTS.Run6)AS Run6
,SUM(PTS.BallsFaced)AS BallsFaced 
     FROM PlayerTeamSeason PTS
     INNER JOIN Player P ON P.ID=PTS.PlayerId 
WHERE P.CrewId =89 and PTS.SeasonId=1

EDIT 1

I need solution for getting

  • MAX value and JOIN(kindly refer Query 1)

EDIT 2

  from crew in Oritia_entities.Crews
       join P in Oritia_entities.Players on crew.ID equals P.CrewId
                                  //select new { P.ID, P.Matches };
       join PTS in Oritia_entities.PlayerTeamSeasons on P.ID equals PTS.PlayerId
        select new
       {
          TotalRuns = PTS.Run1 + PTS.Run2 + PTS.Run3 + PTS.Run4 + PTS.Run6
            ,
          Bowls = PTS.BallsFaced
                                  };

I had re write the query to LINQ. But how can I use SUM here. As I write in my sql query

Thanks

VeeKeyBee

  • 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-06-06T23:44:13+00:00Added an answer on June 6, 2026 at 11:44 pm

    Article on MSDN for SP that returns multiple result sets. Google first.

    LINQ to SQL: returning multiple result sets

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to turn this query to regular inline sql without using stored
When using this SQL query: Select * from table_name what happens if the name
I'm using this SQL query to create an index: $query = CREATE INDEX id_index2
I have this issue: first, I execute a SQL query using Java and then
i have this sql query select * from table where name like ? but
I have this SQL query from the logs select content = 5%id%201=1 from pages
I have this SQL query select case when AllowanceId is null then 2 else
I have a problem in my select statement in my query. This sql query
I'm attempting to write a CompiledQuery using Linq-to-Entities that will replace a stored procedure
Using SQL Server 2008 I created a Stored Procedure called MyStoreProc and it runs

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.