I want to select rows from a table where Id is not equal to 4, How to achieve it using SQL query?
Something like in C# .Where(a=>a.Id != 4).ToList()
?
Or in SQL like Select * Where Id != 4
?
Thanks
Yes you can use not equal to SQL code, using negate in SQL
SELECT *
FROM Table_name
WHERE Column_name <> Value;
//Example
SELECT OrderID, ProductID, Quantity
FROM order_details
WHERE Quantity <> 120;
Or you can use the query below
Select * FROM table_name WHERE Id NOT IN ( value )
Subscribe to our weekly Newsletter & Keep getting latest article/questions in your inbox weekly