Skip to content
Advertisement

Tag: union

SQL UNION Query with Extra uncommon Field in Results

I have Four table, Now I display four common field using UNION sql query. Question : I want to display one uncommon field ( Company ) which in table name as Multiple Product with current result.How can I do it ? Current SQL : Answer You can just add an empty (or NULL) field to the other SELECT queries in

Easy substraction of year’s values

I do have the following database table containing the timestamps in unix format as well as the total yield (summing up) of my solar panels every 5 mins: Now I would like to calculate how much energy was produced each year. I thought of reading the first and last timestamp using UNION of each year: This works fine but I

Advertisement