```
qoega-dev.sas.yp-c.yandex.net :) SELECT toDate('2000-01-01') < toDateTime('2000-01-01 00:00:01', 'Europe/Moscow');

SELECT toDate('2000-01-01') < toDateTime('2000-01-01 00:00:01', 'Europe/Moscow')

Query id: baf63ad5-1893-401c-9728-63bd5c295df1

┌─less(toDate('2000-01-01'), toDateTime('2000-01-01 00:00:01', 'Europe/Moscow'))─┐
│                                                                              0 │
└────────────────────────────────────────────────────────────────────────────────┘

1 rows in set. Elapsed: 0.011 sec.

qoega-dev.sas.yp-c.yandex.net :) SELECT toDate('2000-01-01') < toDateTime('2000-01-01 00:00:01');

SELECT toDate('2000-01-01') < toDateTime('2000-01-01 00:00:01')

Query id: c2136446-a3a0-4567-a94e-68f40dc1f158

┌─less(toDate('2000-01-01'), toDateTime('2000-01-01 00:00:01'))─┐
│                                                             1 │
└───────────────────────────────────────────────────────────────┘

1 rows in set. Elapsed: 0.011 sec.
```
{
        UInt32 have_string = type_ids.count(TypeIndex::String);
        UInt32 have_fixed_string = type_ids.count(TypeIndex::FixedString);
        if (have_string || have_fixed_string)
        {
            bool all_strings = type_ids.size() == (have_string + have_fixed_string);
            if (!all_strings)
                throw Exception(getExceptionMessagePrefix(types) + " because some of them are String/FixedString and some of them are not", ErrorCodes::NO_COMMON_TYPE);
            return std::make_shared<DataTypeString>();
        }
    }
    
    {
        UInt32 have_date = type_ids.count(TypeIndex::Date);
        UInt32 have_datetime = type_ids.count(TypeIndex::DateTime);
        UInt32 have_datetime64 = type_ids.count(TypeIndex::DateTime64);
        if (have_date || have_datetime || have_datetime64)
        {
            bool all_date_or_datetime = type_ids.size() == (have_date + have_datetime + have_datetime64);
            if (!all_date_or_datetime)
                throw Exception(getExceptionMessagePrefix(types) + " because some of them are Date/DateTime/DateTime64 and some of them are not",
                    ErrorCodes::NO_COMMON_TYPE);
            if (have_datetime64 == 0)
                return std::make_shared<DataTypeDateTime>();
            UInt8 max_scale = 0;
            for (const auto & t : types)
            {
                if (const auto * dt64 = typeid_cast<const DataTypeDateTime64 *>(t.get()))
                {
                    const auto scale = dt64->getScale();