Write LINQ query to find 2nd highest salary?
Answer / Neeraj Singh Vimal
To find the 2nd highest salary, you can use the `OrderByDescending` and `Skip` methods. Here is an example: n```csharpndecimal secondHighestSalary = employees.OrderByDescending(e => e.Salary) .Skip(1) .FirstOrDefault()?.Salary ?? default(decimal);n```
| Is This Answer Correct ? | 0 Yes | 0 No |
Define different types of linq?
Why do we use linq in c#?
What is the advantage of linq in c#?
How can you find average of student marks from student tables (columns are studentid, marks)?
What do you understand by datacontext class? How is it related to linq?
Explain Union, Intersect and Except?
Can we use linq with ado net?
What is linqkit?
When to use Single, SingleOrDefault, First and FirstOrDefault?
How LINQ query is compiled to Expression Trees?
Describe the architecture of linq?
How is datacontext class related to linq?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)