Posted on December 19, 2008 by Raghunath Bhandari
Sub Query Update:
if you want to run update query in join or by comparing other table then here is the example.
UPDATE Table1
SET Price = Price * 2
WHERE ProductID IN
(SELECT ID
FROM Table2
WHERE ID= 51);
GO
Here is an equivalent UPDATE statement using a join:
USE [...]
Filed under: SQL Subquery, Stored Procedures | Tagged: Microsoft SQL server, MSSQL, MSSQL server, SQL Server, SQL update with join, Sub Query Update, tow table update, UPDATE statement using a join | 1 Comment »
Posted on October 15, 2008 by Raghunath Bhandari
SQL Subquery
Subquery or Inner query or Nested query is a query in a query. A subquery is usually added in the WHERE Clause of the sql statement. Most of the time, a subquery is used when you know how to search for a value using a SELECT statement, but do not know the exact value.
Subqueries [...]
Filed under: SQL Subquery | Tagged: Advance SQL tips and tricks, Author Raghunath Bhandari, Database, Database Optimization Tips, dba, MCP, Microsoft Certified Professional, Microsoft SQL server, MSDN Help, MSDN SQL News, MSSQL, MSSQL Resources, MSSQL server, MSSQL Server help, SQL, SQL Best practices and tips, SQL Coding Standards, SQL Database Optimization Tricks, SQL Database Settings Optimization Tips, SQL Documentation, SQL help, SQL Optimization, SQL Optimization Tips, SQL Query, SQL Server, SQL server tips, SQL Subquery, SQL technology, SQL Tips, SQL Tips and Tricks, SQL tips for programmer, sqlhelp, sqlhelp news, sqlhelp WebSite Review, T-SQL, Technology News | Leave a Comment »