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

本站现有博文323篇,共被浏览795242

本站已经建立2493天!

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