Skip to content
Advertisement

SQLServer – Is it possible to divide the results of the same column?

I have a table containing the input and output parameters of different APIs. Here is the structure of my database :

The only way to differentiate if a parameter is input or output is the type. If the type is NULL ? It is an output parameter.

So, I would like to know if it is possible in a simple query to make the difference between the two. That is, in my SELECT displayed in one column the name of the input parameters and in another the output parameters, something that could look like this

Or do I have to make two requests? One to get the input parameters, and another one for the output parameters? Knowing that the columns are important because I intend to use them in an API

Sample data :

Exemple result :

Advertisement

Answer

Your question is difficult to understand, but I think you can use a simple case to determine when the parameter is null or not

You can try it out yourself at this Fiddle

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