Skip to content
Advertisement

Merge statement?

I am more of beginner with sql but would like some help on which statement would be best to use for my query. So I have an app that has test data, because the score could be 90 or be 85.6 the values are in different columns – former in int.value, latter in double.value. I need to merge the two columns together into one column for “test_score”. Here is my current query, data goes to a table called “App_test_outcome”:

Would I need to make another query to then merge with the above query already in that table, or is there a way to run a query and merge the two columns together in one. As I would prefer the latter option if possible.

I did get an error message when trying to append a query with double.value to int.value but an error message appeared “invalid schema: Field Test_outcome_score has changed type from FLOAT to INTEGER”. Which makes me think I cannot merge the two columns anyway.

Any help would be great,

Many thanks,

Advertisement

Answer

Maybe IFNULL with CAST will help:

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement