mysql table operations

create table test(id  int(10),name  varchar(20),age  int(10))
insert into test values(1,'avc',18)insert into test values(2,'abc',30)insert into test values(3,'abc',40)


The smallest


Find the number of statistics

Find the id sum

group by having has deduplication function

Next try left connection, right connection, inner connection

Test table data:

Test2 table data:

Left connection sql:

select * from test left join test2 on

Result display:

Right connect sql:

select * from test2 right join test on

Result display:

Inner connection sql:

select * from test  inner join  test2 on;select * from test,test2 where

Result display:

Next, we will show the paging query, sub-query (still using the data in the table test2 above). The sql means to query 2 pieces of data starting from the first row: