SQL操做指令(Sql Server)

/****** 增  ******/
INSERT INTO [DataBaseTest].[dbo].[Table_3] (id, name, url, alexa, country)
VALUES ('100', '百度','https://www.baidu.com/','5555','CNCNCN');url

/****** 刪  ******/
DELETE FROM [DataBaseTest].[dbo].[Table_3]
WHERE name='百度' AND alexa='10';百度

/****** 查  ******/
SELECT *
FROM [DataBaseTest].[dbo].[Table_3]
 
SELECT TOP 2 id
  ,name
FROM [DataBaseTest].[dbo].[Table_3]
 
SELECT *
FROM [DataBaseTest].[dbo].[Table_3]
WHERE country collate Chinese_PRC_CS_AS_WS='cn';淘寶

SELECT * FROM [DataBaseTest].[dbo].[Table_3]
WHERE id > 1
AND (name='淘寶' OR name='菜鳥')
ORDER BY id asc;db

SELECT * FROM [DataBaseTest].[dbo].[Table_3]
WHERE id > 1
AND (name='淘寶' OR name='菜鳥' OR name='百度')
ORDER BY id desc;co

/****** 改  ******/
UPDATE [DataBaseTest].[dbo].[Table_3]
SET alexa='12345', country='USA123'
WHERE name='菜鳥';ps

相關文章
相關標籤/搜索