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:
- How to Solve Docker delete container image error: Error response from daemon: conflict: unable to delete 7cc1942f1ed5 (must be forced)
- [Solved] Emacs27.1 cscope Error: process-kill-without-query
- [Linux] ps+awk +while View process memory usage in real time
- Android converts a view to bitmap + to handle the black edge of the view with rounded corners
- Git: How to delete stash content
- How to Delete New Memory in Vector
- [Solved] keystone Install Error: Failed to parse /etc/keystone/keystone.conf: at /etc/keystone/keystone.conf:687
- How to Export All data in DataGridView to Local Excel
- How to Fix Linux sub process /usr/bin/dpkg returned an error code (1)
- Using apt get to delete software completely
- [Solved] source /etc/profile Error: not a valid identifier
- [Solved] Ubuntu Server 18.4 System /etc/sudoers: syntax error near line 32
- [Solved] bash: /etc/vimrc: line 15: syntax error near unexpected token `“autocmd“‘
- Problem solving / etc/ rc.local The boot entry of the file configuration is invalid
- [Solved] Docker failed to delete image error: no such image: CentOS
- [Solved] SSH Startup Error: unable to load host key /etc/ssh/ssh_host_ed25519_key bad permissions
- ./ungrib.exe Start Error: Could not Fould libpng16.so.16 (/etc/ld.so.conf and ldconfig)
- Nginx Error: Swap file “/etc/nginx/.nginx.conf.swp“ already exists
- Vue uses localstorage and sessionstorage to store data
- The prefix “mvc” for element “mvc:view-controller” is not bound