Sql insert statement

sql insert statement INSERT INTO table_name (column1, column2, column3, …) VALUES (value1, value2, value3, …); sql insert into INSERT INTO table_name (column1, column2, column3, …) VALUES (value1, value2, value3, …); sql insert query –sql insert quest example INSERT INTO table_name (column1, column2, column3, …) VALUES (value1, value2, value3, …); sql insert — Note: This is […]

Sql insert statement Read More

Sql escape quote

sql escape quote DECLARE @my_table TABLE ( [value] VARCHAR(200) ) INSERT INTO @my_table VALUES (‘hi, my name”s tim.’) SELECT * FROM @my_table sql quote in string /*adding single quote into the string in SQL*/ on P.SupplierID=S.SupplierID where S.CompanyName in (‘Tokyo Traders’,’Exotic Liquids’,’Grandma Kelly”s Homestead’)

Sql escape quote Read More

Sql current date

get current date sql SELECT getdate(); — Get Current date in SQL Server mysql current date In MySQL the CURDATE() returns the current date in ‘YYYY-MM-DD’ format or ‘YYYYMMDD’ format depending on whether numeric or string is used in the function. CURRENT_DATE and CURRENT_DATE() are the synonym of CURDATE() sql current date Add GETDATE() in […]

Sql current date Read More

Tsql row number

tsql row number SELECT    ROW_NUMBER() OVER ( ORDER BY first_name    ) row_num,    first_name,    last_name,    city FROM    sales.customers; how to use row number function in sql server USE AdventureWorks2012; GO WITH OrderedOrders AS ( SELECT SalesOrderID, OrderDate, ROW_NUMBER() OVER (ORDER BY OrderDate) AS RowNumber FROM Sales.SalesOrderHeader ) SELECT SalesOrderID, OrderDate, […]

Tsql row number Read More