I'm trying to query from an SQL table. I am having issues getting an if statement to work for a conditional thing I'm trying to achieve in the query.
If the deaths of the player = 0, I want the kd column (ratio) to be equal to kills, not NULL. Here is my current query, I have no clue how to take this.
SELECT name, time, map, kills, deaths, kills/deaths AS kd
FROM history;
Logic I want:
- if deaths = 0: kills/deaths = kills