```
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.
```
if (scale > max_scale)
                        max_scale = scale;
                }
            }
            return std::make_shared<DataTypeDateTime64>(max_scale);
        }
    }
    
    {
        UInt32 have_decimal32 = type_ids.count(TypeIndex::Decimal32);
        UInt32 have_decimal64 = type_ids.count(TypeIndex::Decimal64);
        UInt32 have_decimal128 = type_ids.count(TypeIndex::Decimal128);
        if (have_decimal32 || have_decimal64 || have_decimal128)
        {
            UInt32 num_supported = have_decimal32 + have_decimal64 + have_decimal128;
            std::vector<TypeIndex> int_ids = {TypeIndex::Int8, TypeIndex::UInt8, TypeIndex::Int16, TypeIndex::UInt16,
                                            TypeIndex::Int32, TypeIndex::UInt32, TypeIndex::Int64, TypeIndex::UInt64};
            std::vector<UInt32> num_ints(int_ids.size(), 0);
            TypeIndex max_int = TypeIndex::Nothing;
            for (size_t i = 0; i < int_ids.size(); ++i)
            {
                UInt32 num = type_ids.count(int_ids[i]);
                num_ints[i] = num;
                num_supported += num;
                if (num)
                    max_int = int_ids[i];
            }
            if (num_supported != type_ids.size())
                throw Exception(getExceptionMessagePrefix(types) + " because some of them have no lossless conversion to Decimal",
                                ErrorCodes::NO_COMMON_TYPE);