The question is, why use SELECT col1, col2it when you can just show which columns you like in the application and always use it SELECT *?
The main reasons are as follows:
- Selecting only the columns you want means that the server needs to collect and send less data to the application, making it faster to request and less using resources, especially if you have many columns or some of them contain BLOBs.
- (, , , select, .
- , , , . , - .
:
, SELECT ALL SELECT , .
SELECT ALL - SELECT , .
SELECT DISTINCT . , , :
SELECT DISTINCT col1, col2
,
1,2
1,2
2,2
2,3
1,2
2,2
2,3