--Retrieve duplicate record
SELECT * FROM MovieDB
WHERE Title in (SELECT Title FROM MovieDB GROUP BY Title HAVING COUNT(Title) > 1)
--Delete duplicate record,keep record with low Id value
DELETE FROM MovieDB
WHERE Title IN (SELECT Title FROM MovieDB GROUP BY Title HAVING COUNT(Title) > 1) AND
Id NOT IN (SELECT min(Id) FROM MovieDB GROUP BY Title HAVING COUNT(Title)>1)
--Replace value
UPDATE TableName SET columnName = REPLACE(columnName, 'previous value', 'new value')
--Updating value based on other table
UPDATE TableOne
SET Date1 = TableTwo.Date2
FROM TableOne, TableTwo
WHERE
TableOne.Title = TableOne.Title AND Date1 IS NULL
--Insert file value to table
BULK INSERT URLDate
FROM 'C:\Users\Admin\Desktop\sourceData.txt'
WITH (
FIRSTROW = 1, --data begin
FIELDTERMINATOR = '###', --field delimiter
ROWTERMINATOR = '\n', --Use to shift the control to next row
TABLOCK)
Subscribe to:
Post Comments (Atom)
Setup VNC on Ubuntu 20.04
sudo apt update sudo apt install xfce4 xfce4-goodies sudo apt install tigervnc-standalone-server sudo apt install tightvncserver vncserver...
-
找到samba的配置文件smb.conf,在里面[global]位置下面加入 server min protocol = CORE 保存文件后记得重启samba服务 sudo nano /etc/samba/smb.conf server min protocol = CO...
-
It is available in settings menu of different phone morever you can call on a number provided by service provider to divert calls. Anywa...
-
Tools used by Developer: Statistic Analysis, Dynamic Analysis Tools used by Testers: P erformance testing, Test Management, Test Running,...
No comments:
Post a Comment