ASP DOT NET

Wednesday, September 27, 2023

Thursday, September 7, 2023

How to Use IN Operator into Linq?

using System;

using System.Collections.Generic;

using System.Linq;

class Program

{

    static void Main()

    {

        // Sample collection of items

        List<int> items = new List<int> { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };

        // List of values you want to check against

        List<int> valuesToCheck = new List<int> { 2, 5, 8 };


        // Use LINQ to filter items based on the valuesToCheck list

        var filteredItems = items.Where(item => valuesToCheck.Contains(item));

        // Display the filtered items

        foreach (var item in filteredItems)

        {

            Console.WriteLine(item);

        }

    }

How to to select duplicate rows from sql server?

 SELECT * FROM Recruitment WHERE Email IN (SELECT Email FROM Recruitment GROUP BY Email HAVING COUNT(*) > 1); WITH CTE AS (     SELECT   ...