Support for SQL JOINS. The product will remain incomplete until there is support for the complete range of SQL statements.
In planning.. MySQL only
-
Ange commented
I am having 5 different tables join on my query and it's working very well. I am using ODBC MSSQL - maybe that's why.
-
Chris commented
Since most users have complex queries following relational best practices, not having a complex query capability requires users to work around this with views....and I am not sure if I can use views (have a question into support about that)
-
Brett Power commented
This is my solution: complex SQL query to an array and then onto the grid. This allows for faster modifications of the query without re-writing a VIEW at the database-level.
$sql="SELECT
(CASE
WHEN (`aperto`.tickets.parent > 1)
THEN CONCAT(`aperto`.tickets.`parent`, `aperto`.tickets.child)
ELSE (CONCAT(`aperto`.tickets.id, 'A'))
END) AS 'alpha_id',
`aperto`.tickets.id AS `id`,
`aperto`.tickets.alternate_id AS `alternate_id`,
`aperto`.tickets.parent AS `parent_id`,
`aperto`.tickets.child AS `child_id`,
DATE_FORMAT(`aperto`.`tickets`.`date_entered`,'%m/%d/%Y') AS `date_entered`,
`aperto`.tickets.status AS `status`,
`aperto`.tickets.type AS `type`,
`aperto`.tickets.title AS `title`,
`aperto`.tickets.error_code AS `error_code`,
`login`.`users`.user_name AS `Technician`,
CONCAT('<b>Dealer:</b> ', `aperto`.dealer_account.name,'<BR /><b>Customer:</b> ',`aperto`.customer_account.name) AS `Accounts`
FROM `aperto`.tickets
LEFT JOIN `aperto`.accounts AS `dealer_account` ON `aperto`.`dealer_account`.id = `aperto`.tickets.dealer_account_id
LEFT JOIN `aperto`.accounts AS `customer_account` ON `aperto`.`customer_account`.id = `aperto`.tickets.customer_account_id
LEFT JOIN `login`.`users` ON `login`.`users`.user_id = `aperto`.`tickets`.user_id
";$result = $db->query($sql);
$case_array = array();
while($row = $result -> fetch_array())
{
// Assign $Row array to $Rows array
$product_array[] = $row;
}$product_dg = new C_DataGrid($product_array, "alpha_id", "product_array");
-
AdminRichard (Admin, phpGrid) commented
The recommended approach is to use SQL View for complex queries. Please see
https://phpgrid.uservoice.com/knowledgebase/articles/292348-display-grid-from-multiples-tablesIt is not possible to edit a grid using SQL View.