Skip to content
Advertisement

How to select values between a XML tag in SQL Query

I have a table with CLOB column storing a XML. The structure of XML is unreadable. I want to get values between few tags like <DOMAINID>; sample is shown below. XML: I am using this: Expected result: Actual XML: Answer Do not use regular expressions to parse XML; use a proper XML parser. However, what you have is not properly

MySql pivot for unknown number of column headers

I have a MySql query which I would like to pivot dynamically, with Company names as column headers and the company financial fields as row headers. Currently I have this: which gives me this: Company TotalRevenue Overhead TotalJobCosts GrossProfit Chicago’s Best Construction 2098001 363750 1424420 673581 Jones Construction 4509458 1067008 2876568 1632890 and I wish to get something like this:

Returning multiple aggregated columns from Subquery

I am trying to extend an existing query by aggregating some rows from another table. It works when I only return one column like this: Then I tried to add another column for the aggregated volume: However, this returns the following error: Only one expression can be specified in the select list when the subquery is not introduced with EXISTS.

Filter data based on group SQL Netezza

Please I have the below table, I need to filter the data based on the DATE column, In the Sus_ID level if the DATE column has NULL get this row or if the hasn’t NULL record will get the row for the newest DATE the desired result should be the below I tried the below code but it didn’t work

Advertisement