EADST

Calculate the Ratio with CASE WHEN in SQL

Here is the SQL sentence to calculate the ratio with the case when.

SELECT sku, SUM(CASE WHEN sales_qty='None' THEN 1 END)*1.00/SUM(1)
FROM table
GROUP BY sku;

相关标签
SQL
About Me
XD
Goals determine what you are going to be.
Category
标签云
公式 Use Interview Freesound Bin IndexTTS2 Vim Distillation Breakpoint Pickle 第一性原理 PIP RGB Hungarian OpenCV InvalidArgumentError Dataset 多线程 飞书 Food Sklearn Windows PDF mmap Nginx 继承 净利润 ONNX PyTorch Zip GPT4 版权 Web CSV 递归学习法 Firewall QWEN BTC FP8 Excel UNIX SAM ModelScope TensorFlow 多进程 Python scipy Miniforge Attention uwsgi CTC Datetime XGBoost Paddle v2ray Llama Math CV Color hf FP64 Crawler Tracking Website tar Paper MD5 FlashAttention Heatmap Agent Vmess TTS 签证 顶会 CC Quantize FastAPI Diagram torchinfo UI OpenAI git-lfs 关于博主 Base64 printf VGG-16 Google Disk Safetensors Baidu 腾讯云 XML Tensor Bitcoin Translation Magnet FP32 LLAMA LLM TensorRT Template SQL Logo 强化学习 算法题 Jupyter CEIR Knowledge git BeautifulSoup PyCharm diffusers CLAP 证件照 SPIE FP16 Claude LaTeX Git HuggingFace Transformers Statistics Michelin llama.cpp Mixtral Proxy Video COCO uWSGI Password SQLite Ubuntu Search transformers Anaconda Qwen2.5 Image2Text Streamlit GoogLeNet Qwen2 Shortcut Permission Card ChatGPT LeetCode NameSilo Review Plotly LoRA Linux Bipartite Data DeepSeek NLTK JSON SVR EXCEL HaggingFace PDB YOLO Domain C++ Github VSCode Conda CUDA Quantization Jetson WAN VPN Plate DeepStream Django RAR AI Algorithm TSV BF16 Cloudreve API Hotel 财报 tqdm Clash Augmentation Land 域名 Markdown Numpy ResNet-50 Pandas Pytorch Ptyhon CAM v0.dev OCR GPTQ GGML Hilton WebCrawler 报税 Input Gemma Qwen 音频 Docker logger 图形思考法 Bert NLP 阿里云 Pillow Tiktoken Animate Random GIT 搞笑
站点统计

本站现有博文319篇,共被浏览750824

本站已经建立2405天!

热门文章
文章归档
回到顶部