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

本站现有博文321篇,共被浏览776591

本站已经建立2468天!

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