SELECT *FROM ProductsWHERE SupplierID NOT IN (1,2)
The above example all the products will be retrieved except for products with SupplierID of 1 or 2, here are the results
Latest Posts
SELECT MAX(UnitPrice) AS HighestPrice, MIN(UnitPrice) AS LowestPrice FROM Products
SELECT UnitPrice, ProductName FROM Products ORDER BY UnitPrice DESC, ProductName
SELECT FirstName + ' ' + LastName AS Employee, HireDate FROM Employees WHERE DATEPART(yyyy,HireDate) = 1994
SELECT AVG(UnitPrice) AS AveragePrice FROM Products
SELECT COUNT(*) AS NumberOfRows FROM Customers
SELECT ProductName,UnitPrice FROM Products WHERE ProductName LIKE 'Chef%'
SELECT e.FirstName + ' ' + e.LastName AS Name, t.TerritoryDescription,t.TerritoryID FROM Employees e INNER JOIN EmployeeTerritories et ON et.EmployeeID = e.EmployeeID INNER JOIN Territories t ON t.TerritoryID = et.TerritoryID
SELECT EmployeeID, (FirstName + ' ' + LastName) AS Name FROM Employees WHERE EmployeeID IN (SELECT EmployeeID FROM EmployeeTerritories WHERE TerritoryID=01581)
SELECT COUNT(*) NumberOfProductsByCategory FROM Products GROUP BY CategoryID
CREATE VIEW EmployeeTerritoriesDescriptions AS SELECT e.FirstName + ' ' + e.LastName AS Name, t.TerritoryDescription,t.TerritoryID FROM Employees e INNER JOIN EmployeeTerritories et ON et.EmployeeID = e.EmployeeID INNER JOIN Territories t ON t.TerritoryID = et.TerritoryID
SELECT *FROM ProductsWHERE SupplierID NOT IN (1,2)
SELECT *FROM ProductsWHERE SupplierID IN (1,2)
CREATE DATABASE Northwind ON (name= 'Northwind', filename = 'C:\Northwind.mdf') FOR ATTACH_REBUILD_LOG;
SqlCommand cmd = new SqlCommand("INSERT INTO Users (" + "LoginName," + "FirstName," + "LastName," + "Password," + "Email," + "DOB," + "Sex" + ") VALUES (" + "@Email," + "@FirstName," + "@LastName," + "@Password," + "@Email," + "@DOB," + "@Sex)" + " Select Scope_Identity();",conn);
SELECT CategoryID,ProductName,UnitPriceFROM ProductsWHERE CategoryID = 1 OR CategoryID =2 AND UnitPrice < 15
SELECT OrderID, ShippedDate FROM Orders WHERE ShippedDate IS NULL
SELECT OrderID, ShippedDate FROM Orders WHERE ShippedDate IS NOT NULL
Translate
PC Gaming from AmazonPhones From AmazonVideo Games From Amazon Amazon Daily Deals Amazon Basics (private brand) Refurbished Deals From AmazonPopular Topics
Popular Posts