I have come across quite a few questions reguarding SQL SELECT IF EXISTS but I am unable to piece together exactly what I need.
What I am trying to do is select specific data from a row in one table if that row exists, otherwise create the row with default values, and do it all in one query to the database.
I am able to create the row in the database if it does not already exist, and if it does exist then select the data from the row, but I want to combine the latter two if at all possible.
So, instead of this: 1, check if row exists using SELECT 2, if row does not exist INSERT 3, if row does exist SELECT again to grab data
I would like to do: 1, check if row exists using select, if row does exist grab the data all in the same query 2, if row does not exist insert row
I hope I explained it properly, and thank you all for the assistance it is greatly appreciated!