Toad World® Forums

Coalaesce in query builder

Is there an easy way to do a coalesce in Query Builder, or do you have to manually manipulate the SQL or create a calculated field with the coalesce statement? I don't think it will let you visualize a query after adding it manually to the SQL.

I guess I could write a case statement or if then else as a calculated field instead of trying to use the coalesce function.


You mention a couple of different ways...

Yes, you can manually edit the SQL created by the Query Builder, although it may be difficult to "visualize" the modified query to re-produce the query diagram.

Yes, you can right-click on the query diagram, choose "Calculated Fields" and command line your Coalesce logic that way.

The above are perhaps the most direct way of accomplishing your requirement. Alternatively, the Transform & Cleanse engine (if you have the Pro Edition of TDP) also allows you to specify a calculated column where COALESCE as available as a valid function call to define your column: