I'amI'm trying to convert a delete query with left join to use JDatabaseQuery, but i encounterI am encountering an issue in the query. The query that iI'm trying to convert and which works is the following :
$db->setQuery("DELETE u FROM #__mycomponent_users AS u
LEFT JOIN #__users AS ju ON u.userid=ju.id
WHERE ju.username IS NULL");
I have converted it to JDatabaseQuery, with the following code :
$db->getQuery(true)
->delete($db->quoteName('#__mycomponent_users', 'u'))
->leftJoin($db->quoteName('#__users', 'ju') . ' ON u.userid=ju.id')
->where('ju.username IS NULL');
$db->setQuery($query);
In this, it returnreturns the following error :
Syntax error near 'AS
u
LEFT JOINjt5il_users
ASju
ON u.userid=ju.id WHERE ju.username IS NUL'
So how tocan I make working thethis query work by using JDatabaseQuery ?
Thanks by advance