1. Do Vreports support UNION in the SQL Report

Question

Can a user create an SQL repor in the VReports with UNION function?

What is UNION function?

The UNION function in SQL is used to merge the outcomes of two or more SELECT statements into a single result set. It functions as a set operator that returns only unique rows from the combined SELECT statement outcomes. The resulting set obtained through the UNION operation includes all the rows present in any of the SELECT statements employed in the query, without any repetition.

Answer

Yes, Vreport's SQL reports do support UNION function. Moreover, if you face any issue in regard to it, then you can send us the query you are trying to execute

Example

// SELECT * FROM (


SELECT 
'vtiger_troubletickets' AS record_table,
ticketid AS record_id, 
title AS record_name 
FROM vtiger_troubletickets 

UNION ALL

SELECT 
'vtiger_contactdetails' AS record_table,
contactid AS record_id, 
lastname AS record_name 
FROM vtiger_contactdetails 


) union_records
Extension
Vreports & Dashboards

Description

Do Vreports support UNION in the SQL Report

Created by

Salman (April 06, 2023)

Last updated