Operation command
Data preprocessing: Eliminate any fields in the data with null values
INSERT OVERWRITE TABLE result01
select * from salary
where userid is not null and dept_id is not null and salarys is not null
Eliminate values other than 0-100 in the identity field
INSERT OVERWRITE TABLE result
SELECT * FROM hittable
WHERE identity between 0 and 100 ;
View total
select count(*) from item;
Query the total number of rows for the first product (Item01) that offers beer or wine
select count(*) as num from item where item='Beer' or item01 = 'Wine';
Query the ranking of the best-selling products in the first-purchased products (item01)
select item01,count(item01) as num from item
group by item01
order by num desc;
Query the probability of milk appearing in each row to buy offerings
select b.num/a.num as rate from(
select count(*) num from item) a,
(select count(*) num from item
where item01=='Milk'
or item02=='Milk'
or item02=='Milk'
or item03=='Milk'
or item04=='Milk') b ;
Read More:
- [Solved] Win10 and Linux address reading format is different (CV2. Error: opencv (4.2.0)/Io/opencv…)
- How to Use Annotations in Flutter & Dart
- C#: How to Use Itextsharp to Manipulate PDF Files
- How to Export All data in DataGridView to Local Excel
- [Solved] an error occurred when attempting to lock the volume
- Ffmpeg about Avio_alloc_Context application for memory release
- [Solved] Linux virtual machine startup error: operating system not found
- [Linux] ps+awk +while View process memory usage in real time
- C#: How to get the value or text value of the select drop-down list
- Successful cases of redis distributed lock
- [Solved] xtrabackup Error: “Too many open files” (system error number 24)
- C++ Compile Error: ld returned 1 exit status [How to Solve]
- Termux setting path environment variable
- How to Create Threads in Linux
- Vue uses localstorage and sessionstorage to store data
- Grep: How to Find All the Files Containing a String in Linux
- Android converts a view to bitmap + to handle the black edge of the view with rounded corners
- Docker -v Directory Mount (How to Use)
- SSH Connect Service Error: Could not connect to ‘xxx.xxx.xx.xx‘ (port 22): Connection failed.
- C# implementation of TXT document to table example code