UPDATE
UPDATE tblCalibrationReview
SET poNumber = tblCalibrationReview.[PONumber],
calCertNumber = tblCalibrationReview.[CalCertNumber],
q1Review = (CASE tblCalibrationReview.ReviewQ1 WHEN 'Yes' THEN 1
WHEN 'No' THEN 0 WHEN 'N/A' THEN 3 ELSE 3 END),
followUp = tblCalibrationReview.[Followup]
FROM CalibrationReview AS tblCalibrationReview
LEFT OUTER JOIN tblEquipments ON tblCalibrationReview.equipmentId = tblEquipments.ID
WHERE tblCalibrationReview.[EquipmentNumber] = tblEquipments.AssignedID
_____________________________________________________________________________
Update t1
set t1.DESCRIPTION = t3.DESCRIPTION
from TBL1 t1 inner join TBL2 t2
on t1.UNIQUE_ID = t2.UNIQUE_ID_2
inner join TBL1 t3
on t2.UNIQUE_ID_1 = t3.UNIQUE_ID
______________________________________________________________________________
DELETE
Delete data from table using left outer join
delete t1 FROM projects AS t1 LEFT OUTER JOIN emp_project AS t2 on t1.serial_no= t2.projectid where t1.serial_no=7
what is wrong with query
delete t1,t2 FROM projects AS t1 LEFT OUTER JOIN emp_project AS t2 on t1.serial_no= t2.projectid where t1.serial_no=13
Note:
Your delete statement is incorrect. You've to have two seperate delete statement.
Alternatively you can use Delete Cascade with proper relartionship between two tables
That's what I told you that you can not delete from two tables in single query unless you use delete cascade or have two seperate query
Subscribe to:
Post Comments (Atom)
Abstract Factory Vs Factory Method
Abstract Factory Provides an interface for creating families of related or dependent objects without specifying their concrete classes ...
-
Stored Procedures are pre-compile objects which are compiled for first time and its compiled format is saved which executes (compiled code) ...
-
Web API 1. This is the new framework for building HTTP services with easy and simple way. 2. Web API is open source an ideal ...
-
There are many technologies used to build .NET Web applications. To build effective application-level authentication and authorization s...
No comments:
Post a Comment