- 故意把導風散熱裝置拆下來拍照
- 整理過後導風散熱裝置原貌
- 參考資料:
- 請善待你的電腦
DECLARE @Temp table (SeqNO smallint)
INSERT INTO @Temp VALUES(1)
INSERT INTO @Temp VALUES(3)
INSERT INTO @Temp VALUES(4)
INSERT INTO @Temp VALUES(9)
;
WITH CTE
AS
(
SELECT 1 AS SeqNO
UNION ALL
SELECT SeqNO + 1
FROM CTE
WHERE SeqNO < 5
)
SELECT MIN(T1.SeqNO) AS MinNO
FROM CTE AS T1
LEFT JOIN @Temp AS T2 ON T1.SeqNO = T2.SeqNO
WHERE T2.SeqNO IS NULL
EmployeeID EmployeeName Department Salary
----------- --------------- --------------- ---------
1 T Cook Finance 40000.00
2 D Michael Finance 25000.00
3 A Smith Finance 25000.00
4 D Adams Finance 15000.00
5 M Williams IT 80000.00
6 D Jones IT 40000.00
7 J Miller IT 50000.00
8 L Lewis IT 50000.00
9 A Anderson Back-Office 25000.00
10 S Martin Back-Office 15000.00
11 J Garcia Back-Office 15000.00
12 T Clerk Back-Office 10000.00
SELECT T.EmployeeID , T.EmployeeName, T.Department, T.Salary
FROM
(
SELECT EmployeeID , EmployeeName, Department, Salary ,
RANK() OVER (PARTITION BY Department ORDER BY Salary DESC) AS RANKNO
FROM @Employees
) AS T
WHERE RANKNO = 2
SELECT EmployeeID,EmployeeName,Department,Salary
FROM @Employees e0
WHERE
(
SELECT Count(DISTINCT e1.Salary)
FROM @Employees e1
WHERE e1.Salary >= e0.Salary
AND e1.Department = e0.Department
) = 2
ORDER BY Department, EmployeeID
EmployeeID EmployeeName Department Salary
----------- --------------- --------------- ---------
10 S Martin Back-Office 15000.00
11 J Garcia Back-Office 15000.00
2 D Michael Finance 25000.00
3 A Smith Finance 25000.00
7 J Miller IT 50000.00
8 L Lewis IT 50000.00
-- 新增欄位
ALTER TABLE TableName ADD ColName DataType
-- 刪除欄位
ALTER TABLE TableName DROP COLUMN ColName
-- 修改欄位資料型態
ALTER TABLE TableName ALTER COLUMN ColName DataType
-- 修改欄位名稱
EXEC sp_rename 'TableName.OldColName','NewColName','COLUMN'
loObject = CREATEOBJECT("AutoCAD.Application")
loObject = CREATEOBJECT("AutoCAD.AcadApplication")
-- 宣告 FindExecutable API
DECLARE INTEGER FindExecutable IN shell32 STRING lpFile, STRING lpDir, STRING @lpResult
lcResult = SPACE(250) -- 接收 FindExecutable API 的回傳值,回傳值為執行檔完整路徑
lcTestFile = ADDBS(GETENV("TEMP")) + "Dummy.DWG" -- 建立測試檔案
STRTOFILE("",(lcTestFile)) -- 在 Windows Temp 資料夾內,建立一個沒有內容的 AutoCAD DWG 檔案
IF FindExecutable ((lcTestFile), "", @lcResult) > 32 -- 大於 32 代表執行成功,有 AutoCAD 軟體
MESSAGEBOX(lcResult) -- 顯示 AutoCAD 執行檔路徑
ELSE
MESSAGEBOX("沒有安裝 AutoCAD")
ENDIF
更改測試檔案副檔名(Excel XLS 或 XLSX、Word DOC 或 DOCX),就可以判斷軟體是否安裝在電腦上。