internal SqlSubSelect SubSelect(SqlNodeType nt, SqlSelect select, Type clrType)
        {
            ProviderType sqlType = null;

            switch (nt)
            {
            case SqlNodeType.ScalarSubSelect:
            case SqlNodeType.Element:
                clrType = select.Selection.ClrType;
                sqlType = select.Selection.SqlType;
                break;

            case SqlNodeType.Multiset:
                if (clrType == null)
                {
                    clrType = typeof(List <>).MakeGenericType(select.Selection.ClrType);
                }
                sqlType = typeProvider.GetApplicationType((int)ConverterSpecialTypes.Table);
                break;

            case SqlNodeType.Exists:
                clrType = typeof(bool);
                sqlType = typeProvider.From(typeof(bool));
                break;
            }
            return(new SqlSubSelect(nt, clrType, sqlType, select));
        }