当前位置:网站首页>SQL query, if value is null then return 1 - SQL query, if value is null then return 1
SQL query, if value is null then return 1 - SQL query, if value is null then return 1
2022-06-25 07:10:00 【French red wine sweet】
problem :
I have a query that is returning the exchange rate value set up in our system. I have a query to return the exchange rate value set in our system .Not every order will have an exchange rate (currate.currentrate) so it is returning null values. Not every order has an exchange rate (currate.currentrate), So it returns a null value .
Can I get it to return 1 instead of null? I can get it back 1 instead of null Do you ?
Something like an if statement maybe: similar if The thing of a statement may be :
if isnull(currate.currentrate) then 1 else currate.currentrate Here is my query below. This is my query below .I greatly appreciate all your help! I really appreciate your help !
SELECT orderhed.ordernum, orderhed.orderdate, currrate.currencycode, currrate.currentrate FROM orderhed LEFT OUTER JOIN currrate ON orderhed.company = currrate.company AND orderhed.orderdate = currrate.effectivedateSolution :
Reference resources : https://stackoom.com/en/question/10mYE边栏推荐
- 【一起上水硕系列】Day 4
- Derivation of COS (a-b) =cosa*cosb+sina*sinb
- Lotus v1.16.0-rc2 Calibration net
- Blue Bridge Cup SCM module code (external interrupt) (code + comment)
- Flask 的入门级使用
- [Shangshui Shuo series] day 4
- Message queue table structure for storing message data
- Uncaught TypeError: Cannot read properties of undefined (reading ‘prototype‘)
- In depth analysis of Apache bookkeeper series: Part 3 - reading principle
- 48 pictures | teach you the performance monitoring, pressure testing and tuning of microservices by hand
猜你喜欢

2022 biological fermentation Exhibition (Jinan), which is a must read before the exhibition. The most comprehensive exhibition strategy will take you around the "fermentation circle"

有了 MySQL 为什么要用 NoSQL?

レ / leilei

Derivation of sin (a-b) =sina*cosb-sinb*cosa

3dmax软件的制作木桶过程:三步流程

Kubernetes 集群中流量暴露的几种方案

有能力的人从不抱怨大环境!

Simple and complete steps of vivado project

Why use NoSQL with MySQL?

48 pictures | teach you the performance monitoring, pressure testing and tuning of microservices by hand
随机推荐
Event registration | Apache pulsar x kubesphere online meetup is coming
Non-contact infrared temperature measurement system for human body based on single chip microcomputer
Pratique de gestion hiérarchique basée sur kubesphere
Changing the background color of tab bar - changing the background color of tab bar
Navicat prevent new query from being deleted by mistake
Hongmeng learning notes: creating layouts using XML
Simple and complete steps of vivado project
How to configure log4j to only keep log files for the last seven days?
ASP. Net core - Safety of asynclocal in asp NET Core
Following the last minor upgrade of nodemcu (esp8266)
爱情️终结者
使用OpenGL绘制shp文件
【一起上水硕系列】Day 4
[从零开始学习FPGA编程-43]:视野篇 - 后摩尔时代”芯片设计的技术演进-2-演进方向
In depth analysis of Apache bookkeeper series: Part 3 - reading principle
Uncaught TypeError: Cannot read properties of undefined (reading ‘prototype‘)
Bcrypt password encryption kalrry
活动报名|Apache Pulsar x KubeSphere 在线 Meetup 火热报名中
基于 KubeSphere 的分级管理实践
【工具分享】一款颜值与技能并重的软件