SELECT中的mySQL空SELECT不应为整个查询返回null

I'm using a select in a select, like this :

SELECT id, 
(
    SELECT name FROM xxx WHERE xxx
) as y 
FROM xxx

But this y is null. And because of this, the whole query is returning null. I want this y to be a 0 if it is equal to null so not to change the result of the whole query which should return several tuples.

Here my full query :

        SELECT id, begin, end, location_id, out_location_id, lat, lng, out_lat, out_lng, LEFT(TIMEDIFF(end, begin), 5) as duration, 
        (
          SELECT LEFT(TIMEDIFF(end, begin), 5)
          FROM timeslots l
          WHERE user_id = '.$userId.'
          AND type = '.Timeslot::LUNCH.'
          AND parent_id = t.id 
        ) as lunch, 
        (
          SELECT LEFT(TIMEDIFF(end, begin), 5)
          FROM timeslots o
          WHERE user_id = '.$userId.'
          AND type = '.Timeslot::OVERTIME.'
          AND parent_id = t.id 
        ) as overtime
        FROM timeslots t
        WHERE user_id = '.$userId.'
        AND approved = 1
        AND type = '.Timeslot::DAY.'
        AND DATE(begin) >= "'.$startDay.'"
        AND DATE(end) <= "'.$endDay.'"
        ORDER BY begin

I tried COALESC(y, 0) and IFNULL(y, 0) but it doesn't work :/

thanks for you help

UPDATE

I just noticed that when I remove the first subquery, it works ! So it means that the issues comes from this first subquery and not both of them. What's changing the result of the whole query is the line type = Timeslot::LUNCH (which is 2). But on the second subquery I have Timeslot::OVERTIME which is 3 so it's the same thing but it's working...

This is too long for a comment.

Subqueries in the SELECT are called scalar subqueries. These always return one column and at most one row. If they return no rows, then the value is NULL.

They do not filter rows out of the result set. It is as simple as that.

In other words, nothing you do in the two subqueries in the SELECT will affect the number of rows returned. They only affect the value for that particular column.