One:
When paging a query, SQL Server uses the top keyword, and MySQL uses the limit
e.g:
Search for fifth to tenth entry-level staff
SQL server2000:
Select Top 6 * from EMP where empno not in (select Top 4 empno from emp Order by HireDate) order by HireDate;
Mysql:
SELECT * from emp order BY hire date limit 4, 6;
P.s:limit a means the previous a record
Limit A, a, means the record from article (a+1) to article (A+B) and, if b=-1, means from (a+1) to the last record;
Two:
Title: How can I delete duplicate data from a table?
Like there's a watch.
CREATE TABLE Cat (catId int,catname varchar (30));
INSERT into Cat (1, ' AA ');
This sentence is executed nine times;
INSERT into Cat (2, ' BB ');
This sentence is executed nine times;
SQL Server Edition: 4 words
SELECT DISTINCT * to cattemp from cat;
Delete from Cat;
INSERT INTO Cat select * from Cattemp;
drop table cattemp;
MySQL version:
Create temporary table cattemp (SELECT DISTINCT * from cat);
Delete from Cat;
INSERT INTO Cat select * from Cattemp;
drop table cattemp;
Differences between SQL Server and MySQL paging queries and creating temporary tables