I'am trying to convert delete query with left join to use JDatabaseQuery, but i encounter an issue in the query. The query that i 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 return the following error :
Syntax error near 'AS
u
LEFT JOINjt5il_users
ASju
ON u.userid=ju.id WHERE ju.username IS NUL'
So how to make working the query by using JDatabaseQuery ?
Thanks by advance