Skip to main content

AddToAny

Share/Save

SQL

How Sql Joins Works

To make this article, I have taken Table A and Table B as reference tables for explaining.

SELECT * FROM A
id          name                       RowState
----------- ------------------------------ --------
1           A1                             1
2           A2                             1
3           A3                             0
4           A4                             0
5           A5                             1
 
(5 row(s) affected)
 
SELECT * FROM B
 
id          name                           RowState aid

Delete Duplicate Records From a table

I need to clean duplicate records from a table, please let me know how to it.

Difference between Delete and Truncate

Removing records from a table is a crucial operation. So I would like to pen down my knowledge about removing records from a table. There are two ways to do the same, Truncate and Delete.

I would like to explain the basic difference between two.

1. Delete is a DML whereas truncate is a DDL. Truncate deallocates the data pages for the table and does'nt delete them row by row. So if there is an Identity column in the table it would be reset to initial seed after truncate.

What is the alternative of 'TOP' in MySql

Posted in

I have been using 'TOP' keyword in Sql Server for limiting the results return by a query.

But I don't see any TOP keyword in MYSql. There must be some alternative to do that.

Please help.

Syndicate content