Get the App
SLTechnology News&Howtos  ›  Database  › 

What are the more practical SQL statements?

Shulou Source: shulou.com Published: 2022-05-31 17:39:22 10月01日 Update

This article mainly introduces "what are the more practical SQL sentences". In daily operation, I believe many people have doubts about the more practical SQL sentences. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts of "what are the more practical SQL sentences?" Next, please follow the editor to study!

Id name

1 a

2 b

3 c

1 a

2 b

3 c

The following sql statements are subject to mytable in the above table:

1. Query all data recorded by id=1,3 select * from mytable

Where id in (1pr 3)

2. Delete the duplicated data of id. Only all data of id=1,2,3 is left in the table select * into # from mytable

Truncate table mytable

Insert table select distinct * from #

Select * from table

Drop table #

At this point, the study of "what are the more practical SQL sentences" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Tags: Practical sentence data learning more help next articles methods theories knowledge articles websites materials follow questions easy to use practice queries answers Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno Apple vpn Shulou Technology Redmi