Bug Fix - Ensure DataQuery::exists() SQL is both valid MySQL and T-SQL
The original SQL statement is not valid T-SQL for use with SQL Server
This commit is contained in:
parent
2f5d976072
commit
33365b92f3
|
@ -479,7 +479,7 @@ class DataQuery
|
|||
}
|
||||
|
||||
// Wrap the whole thing in an "EXISTS"
|
||||
$sql = 'SELECT EXISTS(' . $statement->sql($params) . ')';
|
||||
$sql = 'SELECT CASE WHEN EXISTS(' . $statement->sql($params) . ') THEN 1 ELSE 0 END';
|
||||
$result = DB::prepared_query($sql, $params);
|
||||
$row = $result->first();
|
||||
$result = reset($row);
|
||||
|
|
Loading…
Reference in New Issue