MSSQLSERVER数据库- 杂记

查看语句执行时间:

SET STATISTICS IO ON
SET STATISTICS TIME ON

SELECT * FROM dbo.NewsInfo

 

Update的表关联例子:

UPDATE t1
SET BZ = '电话:' + CONVERT(VARCHAR(100), t2.CY_DH) + ',日期:'
+ CONVERT(VARCHAR(100), t2.CY_RQ1, 120) + ',箱数:'
+ CONVERT(VARCHAR(100), t2.SL_X)
FROM dbo.DLSHD t1
INNER JOIN dbo.DJ_CYINFO t2 ON t1.LXDJ = t2.DJBH
WHERE t1.LXDJ = 'OJ0042063835'

 

你可能感兴趣的:(sqlserver)