mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-17 20:02:05 +00:00
Add initial explain.
This commit is contained in:
parent
8b2232dc5e
commit
e1481ccfc2
@ -12,14 +12,20 @@
|
||||
#include <Parsers/ASTExplainQuery.h>
|
||||
#include <Parsers/ASTTablesInSelectQuery.h>
|
||||
#include <Parsers/ASTSelectQuery.h>
|
||||
#include <IO/WriteBufferFromOStream.h>
|
||||
|
||||
#include <Storages/StorageView.h>
|
||||
#include <sstream>
|
||||
|
||||
#include <Processors/QueryPlan/QueryPlan.h>
|
||||
|
||||
namespace DB
|
||||
{
|
||||
|
||||
namespace ErrorCodes
|
||||
{
|
||||
extern const int INCORRECT_QUERY;
|
||||
}
|
||||
|
||||
namespace
|
||||
{
|
||||
struct ExplainAnalyzedSyntaxMatcher
|
||||
@ -79,10 +85,31 @@ Block InterpreterExplainQuery::getSampleBlock()
|
||||
return block;
|
||||
}
|
||||
|
||||
static void fillColumn(IColumn & column, const std::string & str)
|
||||
{
|
||||
size_t start = 0;
|
||||
size_t end = 0;
|
||||
size_t size = str.size();
|
||||
|
||||
while (end < size)
|
||||
{
|
||||
if (str[end] == '\n')
|
||||
{
|
||||
column.insertData(str.data() + start, end - start);
|
||||
start = end + 1;
|
||||
}
|
||||
|
||||
++end;
|
||||
}
|
||||
|
||||
if (start < end)
|
||||
column.insertData(str.data() + start, end - start);
|
||||
}
|
||||
|
||||
BlockInputStreamPtr InterpreterExplainQuery::executeImpl()
|
||||
{
|
||||
const auto & ast = query->as<ASTExplainQuery &>();
|
||||
|
||||
Block sample_block = getSampleBlock();
|
||||
MutableColumns res_columns = sample_block.cloneEmptyColumns();
|
||||
|
||||
@ -99,8 +126,21 @@ BlockInputStreamPtr InterpreterExplainQuery::executeImpl()
|
||||
|
||||
ast.children.at(0)->format(IAST::FormatSettings(ss, false));
|
||||
}
|
||||
else if (ast.getKind() == ASTExplainQuery::QueryPlan)
|
||||
{
|
||||
if (!dynamic_cast<const ASTSelectWithUnionQuery *>(ast.getExplainedQuery().get()))
|
||||
throw Exception("Only SELECT is supported for EXPLAIN query", ErrorCodes::INCORRECT_QUERY);
|
||||
|
||||
res_columns[0]->insert(ss.str());
|
||||
QueryPlan plan;
|
||||
|
||||
InterpreterSelectWithUnionQuery interpreter(ast.getExplainedQuery(), context, SelectQueryOptions());
|
||||
interpreter.buildQueryPlan(plan);
|
||||
|
||||
WriteBufferFromOStream buffer(ss);
|
||||
plan.explain(buffer);
|
||||
}
|
||||
|
||||
fillColumn(*res_columns[0], ss.str());
|
||||
|
||||
return std::make_shared<OneBlockInputStream>(sample_block.cloneWithColumns(std::move(res_columns)));
|
||||
}
|
||||
|
@ -968,7 +968,7 @@ void InterpreterSelectQuery::executeImpl(QueryPlan & query_plan, const BlockInpu
|
||||
*/
|
||||
|
||||
if (!expressions.first_stage && !expressions.need_aggregate && !(query.group_by_with_totals && !aggregate_final))
|
||||
executeMergeSorted(query_plan, "before ORDER BY");
|
||||
executeMergeSorted(query_plan, "for ORDER BY");
|
||||
else /// Otherwise, just sort.
|
||||
executeOrder(query_plan, query_info.input_order_info);
|
||||
}
|
||||
@ -1596,7 +1596,7 @@ void InterpreterSelectQuery::executeOrder(QueryPlan & query_plan, InputOrderInfo
|
||||
limit,
|
||||
SizeLimits(settings.max_rows_to_sort, settings.max_bytes_to_sort, settings.sort_overflow_mode));
|
||||
|
||||
partial_sorting->setStepDescription("Sort each block before ORDER BY");
|
||||
partial_sorting->setStepDescription("Sort each block for ORDER BY");
|
||||
query_plan.addStep(std::move(partial_sorting));
|
||||
|
||||
/// Merge the sorted blocks.
|
||||
@ -1607,11 +1607,11 @@ void InterpreterSelectQuery::executeOrder(QueryPlan & query_plan, InputOrderInfo
|
||||
settings.max_bytes_before_external_sort, context->getTemporaryVolume(),
|
||||
settings.min_free_disk_space_for_temporary_data);
|
||||
|
||||
merge_sorting_step->setStepDescription("Merge sorted blocks before ORDER BY");
|
||||
merge_sorting_step->setStepDescription("Merge sorted blocks for ORDER BY");
|
||||
query_plan.addStep(std::move(merge_sorting_step));
|
||||
|
||||
/// If there are several streams, we merge them into one
|
||||
executeMergeSorted(query_plan, output_order_descr, limit, "before ORDER BY");
|
||||
executeMergeSorted(query_plan, output_order_descr, limit, "for ORDER BY");
|
||||
}
|
||||
|
||||
|
||||
|
@ -35,7 +35,7 @@ public:
|
||||
return res;
|
||||
}
|
||||
|
||||
ASTPtr & getExplainedQuery() { return children.at(0); }
|
||||
const ASTPtr & getExplainedQuery() const { return children.at(0); }
|
||||
|
||||
protected:
|
||||
void formatQueryImpl(const FormatSettings & settings, FormatState & state, FormatStateStacked frame) const override
|
||||
|
@ -41,7 +41,7 @@ bool ParserExplainQuery::parseImpl(Pos & pos, ASTPtr & node, Expected & expected
|
||||
auto explain_query = std::make_shared<ASTExplainQuery>(kind, old_syntax);
|
||||
|
||||
ParserSelectWithUnionQuery select_p;
|
||||
if (!select_p.parse(pos, explain_query->getExplainedQuery(), expected))
|
||||
if (!select_p.parse(pos, explain_query->children.at(0), expected))
|
||||
return false;
|
||||
|
||||
node = std::move(explain_query);
|
||||
|
@ -109,6 +109,17 @@ bool ParserQueryWithOutput::parseImpl(Pos & pos, ASTPtr & node, Expected & expec
|
||||
query_with_output.children.push_back(query_with_output.settings_ast);
|
||||
}
|
||||
|
||||
if (auto * ast = query->as<ASTExplainQuery>())
|
||||
{
|
||||
/// Set default format TSV, because output is a single string column.
|
||||
if (!ast->format)
|
||||
{
|
||||
ast->format = std::make_shared<ASTIdentifier>("TSV");
|
||||
ast->children.push_back(ast->format);
|
||||
}
|
||||
}
|
||||
|
||||
node = std::move(query);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
#include <Processors/QueryPlan/QueryPlan.h>
|
||||
#include <Processors/QueryPlan/IQueryPlanStep.h>
|
||||
#include <Processors/QueryPipeline.h>
|
||||
#include <IO/WriteBuffer.h>
|
||||
#include <stack>
|
||||
|
||||
namespace DB
|
||||
@ -11,6 +12,7 @@ namespace ErrorCodes
|
||||
extern const int LOGICAL_ERROR;
|
||||
}
|
||||
|
||||
QueryPlan::QueryPlan() = default;
|
||||
QueryPlan::~QueryPlan() = default;
|
||||
|
||||
void QueryPlan::checkInitialized() const
|
||||
@ -173,4 +175,55 @@ void QueryPlan::addInterpreterContext(std::shared_ptr<Context> context)
|
||||
interpreter_context.emplace_back(std::move(context));
|
||||
}
|
||||
|
||||
void QueryPlan::explain(WriteBuffer & buffer)
|
||||
{
|
||||
checkInitialized();
|
||||
|
||||
size_t ident = 2;
|
||||
|
||||
struct Frame
|
||||
{
|
||||
Node * node;
|
||||
bool is_description_printed = false;
|
||||
size_t next_child = 0;
|
||||
};
|
||||
|
||||
std::stack<Frame> stack;
|
||||
stack.push(Frame{.node = root});
|
||||
|
||||
while (!stack.empty())
|
||||
{
|
||||
auto & frame = stack.top();
|
||||
|
||||
if (!frame.is_description_printed)
|
||||
{
|
||||
std::string prefix((stack.size() - 1) * ident, ' ');
|
||||
buffer.write(prefix.data(), prefix.size());
|
||||
|
||||
auto name = frame.node->step->getName();
|
||||
buffer.write(name.data(), name.size());
|
||||
|
||||
auto description = frame.node->step->getStepDescription();
|
||||
if (!description.empty())
|
||||
{
|
||||
buffer.write(" (", 2);
|
||||
buffer.write(description.data(), description.size());
|
||||
buffer.write(')');
|
||||
}
|
||||
|
||||
buffer.write('\n');
|
||||
|
||||
frame.is_description_printed = true;
|
||||
}
|
||||
|
||||
if (frame.next_child < frame.node->children.size())
|
||||
{
|
||||
stack.push(Frame{frame.node->children[frame.next_child]});
|
||||
++frame.next_child;
|
||||
}
|
||||
else
|
||||
stack.pop();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -15,11 +15,13 @@ class QueryPipeline;
|
||||
using QueryPipelinePtr = std::unique_ptr<QueryPipeline>;
|
||||
|
||||
class Context;
|
||||
class WriteBuffer;
|
||||
|
||||
/// A tree of query steps.
|
||||
class QueryPlan
|
||||
{
|
||||
public:
|
||||
QueryPlan();
|
||||
~QueryPlan();
|
||||
|
||||
void unitePlans(QueryPlanStepPtr step, std::vector<QueryPlan> plans);
|
||||
@ -31,6 +33,8 @@ public:
|
||||
|
||||
QueryPipelinePtr buildQueryPipeline();
|
||||
|
||||
void explain(WriteBuffer & buffer);
|
||||
|
||||
/// Set upper limit for the recommend number of threads. Will be applied to the newly-created pipelines.
|
||||
/// TODO: make it in a better way.
|
||||
void setMaxThreads(size_t max_threads_) { max_threads = max_threads_; }
|
||||
|
@ -4,61 +4,582 @@
|
||||
1
|
||||
2000-01-01 1 test string 1 1
|
||||
-------Forbid push down-------
|
||||
SELECT count()\nFROM \n(\n SELECT \n [number] AS a,\n [number * 2] AS b\n FROM system.numbers\n LIMIT 1\n) AS t\nARRAY JOIN \n a,\n b\nWHERE NOT ignore(a + b)
|
||||
SELECT count()
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
[number] AS a,
|
||||
[number * 2] AS b
|
||||
FROM system.numbers
|
||||
LIMIT 1
|
||||
) AS t
|
||||
ARRAY JOIN
|
||||
a,
|
||||
b
|
||||
WHERE NOT ignore(a + b)
|
||||
1
|
||||
SELECT \n a,\n b\nFROM \n(\n SELECT 1 AS a\n)\nANY LEFT JOIN \n(\n SELECT \n 1 AS a,\n 1 AS b\n) USING (a)\nWHERE b = 0
|
||||
SELECT \n a,\n b\nFROM \n(\n SELECT \n 1 AS a,\n 1 AS b\n)\nANY RIGHT JOIN \n(\n SELECT 1 AS a\n) USING (a)\nWHERE b = 0
|
||||
SELECT \n a,\n b\nFROM \n(\n SELECT 1 AS a\n)\nANY FULL OUTER JOIN \n(\n SELECT \n 1 AS a,\n 1 AS b\n) USING (a)\nWHERE b = 0
|
||||
SELECT \n a,\n b\nFROM \n(\n SELECT \n 1 AS a,\n 1 AS b\n)\nANY FULL OUTER JOIN \n(\n SELECT 1 AS a\n) USING (a)\nWHERE b = 0
|
||||
SELECT
|
||||
a,
|
||||
b
|
||||
FROM
|
||||
(
|
||||
SELECT 1 AS a
|
||||
)
|
||||
ANY LEFT JOIN
|
||||
(
|
||||
SELECT
|
||||
1 AS a,
|
||||
1 AS b
|
||||
) USING (a)
|
||||
WHERE b = 0
|
||||
SELECT
|
||||
a,
|
||||
b
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
1 AS a,
|
||||
1 AS b
|
||||
)
|
||||
ANY RIGHT JOIN
|
||||
(
|
||||
SELECT 1 AS a
|
||||
) USING (a)
|
||||
WHERE b = 0
|
||||
SELECT
|
||||
a,
|
||||
b
|
||||
FROM
|
||||
(
|
||||
SELECT 1 AS a
|
||||
)
|
||||
ANY FULL OUTER JOIN
|
||||
(
|
||||
SELECT
|
||||
1 AS a,
|
||||
1 AS b
|
||||
) USING (a)
|
||||
WHERE b = 0
|
||||
SELECT
|
||||
a,
|
||||
b
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
1 AS a,
|
||||
1 AS b
|
||||
)
|
||||
ANY FULL OUTER JOIN
|
||||
(
|
||||
SELECT 1 AS a
|
||||
) USING (a)
|
||||
WHERE b = 0
|
||||
-------Need push down-------
|
||||
SELECT toString(value) AS value\nFROM \n(\n SELECT 1 AS value\n)
|
||||
SELECT toString(value) AS value
|
||||
FROM
|
||||
(
|
||||
SELECT 1 AS value
|
||||
)
|
||||
1
|
||||
SELECT id\nFROM \n(\n SELECT 1 AS id\n UNION ALL\n SELECT 2 AS `--predicate_optimizer_0`\n WHERE 0\n)\nWHERE id = 1
|
||||
SELECT id
|
||||
FROM
|
||||
(
|
||||
SELECT 1 AS id
|
||||
UNION ALL
|
||||
SELECT 2 AS `--predicate_optimizer_0`
|
||||
WHERE 0
|
||||
)
|
||||
WHERE id = 1
|
||||
1
|
||||
SELECT id\nFROM \n(\n SELECT arrayJoin([1, 2, 3]) AS id\n WHERE id = 1\n)\nWHERE id = 1
|
||||
SELECT id
|
||||
FROM
|
||||
(
|
||||
SELECT arrayJoin([1, 2, 3]) AS id
|
||||
WHERE id = 1
|
||||
)
|
||||
WHERE id = 1
|
||||
1
|
||||
SELECT id\nFROM \n(\n SELECT arrayJoin([1, 2, 3]) AS id\n WHERE id = 1\n)\nWHERE id = 1
|
||||
SELECT id
|
||||
FROM
|
||||
(
|
||||
SELECT arrayJoin([1, 2, 3]) AS id
|
||||
WHERE id = 1
|
||||
)
|
||||
WHERE id = 1
|
||||
1
|
||||
SELECT \n id,\n subquery\nFROM \n(\n SELECT \n 1 AS id,\n CAST(1, \'UInt8\') AS subquery\n)
|
||||
SELECT
|
||||
id,
|
||||
subquery
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
1 AS id,
|
||||
CAST(1, \'UInt8\') AS subquery
|
||||
)
|
||||
1 1
|
||||
SELECT \n a,\n b\nFROM \n(\n SELECT \n toUInt64(sum(id) AS b) AS a,\n b\n FROM test_00597\n HAVING a = 3\n)\nWHERE a = 3
|
||||
SELECT
|
||||
a,
|
||||
b
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
toUInt64(sum(id) AS b) AS a,
|
||||
b
|
||||
FROM test_00597
|
||||
HAVING a = 3
|
||||
)
|
||||
WHERE a = 3
|
||||
3 3
|
||||
SELECT \n date,\n id,\n name,\n value\nFROM \n(\n SELECT \n date,\n name,\n value,\n min(id) AS id\n FROM test_00597\n GROUP BY \n date,\n name,\n value\n HAVING id = 1\n)\nWHERE id = 1
|
||||
SELECT
|
||||
date,
|
||||
id,
|
||||
name,
|
||||
value
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
date,
|
||||
name,
|
||||
value,
|
||||
min(id) AS id
|
||||
FROM test_00597
|
||||
GROUP BY
|
||||
date,
|
||||
name,
|
||||
value
|
||||
HAVING id = 1
|
||||
)
|
||||
WHERE id = 1
|
||||
2000-01-01 1 test string 1 1
|
||||
SELECT \n a,\n b\nFROM \n(\n SELECT \n toUInt64(sum(id) AS b) AS a,\n b\n FROM test_00597 AS table_alias\n HAVING b = 3\n) AS outer_table_alias\nWHERE b = 3
|
||||
SELECT
|
||||
a,
|
||||
b
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
toUInt64(sum(id) AS b) AS a,
|
||||
b
|
||||
FROM test_00597 AS table_alias
|
||||
HAVING b = 3
|
||||
) AS outer_table_alias
|
||||
WHERE b = 3
|
||||
3 3
|
||||
SELECT \n date,\n id,\n name,\n value\nFROM \n(\n SELECT \n date,\n id,\n name,\n value\n FROM test_00597\n WHERE id = 1\n)\nWHERE id = 1
|
||||
SELECT
|
||||
date,
|
||||
id,
|
||||
name,
|
||||
value
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
date,
|
||||
id,
|
||||
name,
|
||||
value
|
||||
FROM test_00597
|
||||
WHERE id = 1
|
||||
)
|
||||
WHERE id = 1
|
||||
2000-01-01 1 test string 1 1
|
||||
SELECT \n date,\n id,\n name,\n value\nFROM \n(\n SELECT \n date,\n id,\n name,\n value\n FROM \n (\n SELECT \n date,\n id,\n name,\n value\n FROM test_00597\n WHERE id = 1\n )\n WHERE id = 1\n)\nWHERE id = 1
|
||||
SELECT
|
||||
date,
|
||||
id,
|
||||
name,
|
||||
value
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
date,
|
||||
id,
|
||||
name,
|
||||
value
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
date,
|
||||
id,
|
||||
name,
|
||||
value
|
||||
FROM test_00597
|
||||
WHERE id = 1
|
||||
)
|
||||
WHERE id = 1
|
||||
)
|
||||
WHERE id = 1
|
||||
2000-01-01 1 test string 1 1
|
||||
SELECT \n date,\n id,\n name,\n value\nFROM \n(\n SELECT \n date,\n id,\n name,\n value\n FROM \n (\n SELECT \n date,\n id,\n name,\n value\n FROM test_00597\n WHERE id = 1\n ) AS b\n WHERE id = 1\n)\nWHERE id = 1
|
||||
SELECT
|
||||
date,
|
||||
id,
|
||||
name,
|
||||
value
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
date,
|
||||
id,
|
||||
name,
|
||||
value
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
date,
|
||||
id,
|
||||
name,
|
||||
value
|
||||
FROM test_00597
|
||||
WHERE id = 1
|
||||
) AS b
|
||||
WHERE id = 1
|
||||
)
|
||||
WHERE id = 1
|
||||
2000-01-01 1 test string 1 1
|
||||
SELECT \n date,\n id,\n name,\n value\nFROM \n(\n SELECT \n date,\n id,\n name,\n value\n FROM test_00597\n WHERE id = 1\n)\nWHERE id = 1
|
||||
SELECT
|
||||
date,
|
||||
id,
|
||||
name,
|
||||
value
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
date,
|
||||
id,
|
||||
name,
|
||||
value
|
||||
FROM test_00597
|
||||
WHERE id = 1
|
||||
)
|
||||
WHERE id = 1
|
||||
2000-01-01 1 test string 1 1
|
||||
SELECT \n date,\n id,\n name,\n value\nFROM \n(\n SELECT \n date,\n id,\n name,\n value\n FROM \n (\n SELECT \n date,\n id,\n name,\n value\n FROM test_00597\n WHERE id = 1\n )\n WHERE id = 1\n)\nWHERE id = 1
|
||||
SELECT
|
||||
date,
|
||||
id,
|
||||
name,
|
||||
value
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
date,
|
||||
id,
|
||||
name,
|
||||
value
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
date,
|
||||
id,
|
||||
name,
|
||||
value
|
||||
FROM test_00597
|
||||
WHERE id = 1
|
||||
)
|
||||
WHERE id = 1
|
||||
)
|
||||
WHERE id = 1
|
||||
2000-01-01 1 test string 1 1
|
||||
SELECT \n date,\n id,\n name,\n value\nFROM \n(\n SELECT \n date,\n id,\n name,\n value\n FROM test_00597\n WHERE id = 1\n) AS b\nWHERE id = 1
|
||||
SELECT
|
||||
date,
|
||||
id,
|
||||
name,
|
||||
value
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
date,
|
||||
id,
|
||||
name,
|
||||
value
|
||||
FROM test_00597
|
||||
WHERE id = 1
|
||||
) AS b
|
||||
WHERE id = 1
|
||||
2000-01-01 1 test string 1 1
|
||||
SELECT \n date,\n id,\n name,\n value\nFROM \n(\n SELECT \n date,\n id,\n name,\n value\n FROM \n (\n SELECT \n date,\n id,\n name,\n value\n FROM test_00597\n WHERE id = 1\n ) AS a\n WHERE id = 1\n) AS b\nWHERE id = 1
|
||||
SELECT
|
||||
date,
|
||||
id,
|
||||
name,
|
||||
value
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
date,
|
||||
id,
|
||||
name,
|
||||
value
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
date,
|
||||
id,
|
||||
name,
|
||||
value
|
||||
FROM test_00597
|
||||
WHERE id = 1
|
||||
) AS a
|
||||
WHERE id = 1
|
||||
) AS b
|
||||
WHERE id = 1
|
||||
2000-01-01 1 test string 1 1
|
||||
SELECT \n id,\n date,\n value\nFROM \n(\n SELECT \n id,\n date,\n min(value) AS value\n FROM test_00597\n WHERE id = 1\n GROUP BY \n id,\n date\n)\nWHERE id = 1
|
||||
SELECT
|
||||
id,
|
||||
date,
|
||||
value
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
id,
|
||||
date,
|
||||
min(value) AS value
|
||||
FROM test_00597
|
||||
WHERE id = 1
|
||||
GROUP BY
|
||||
id,
|
||||
date
|
||||
)
|
||||
WHERE id = 1
|
||||
1 2000-01-01 1
|
||||
SELECT \n date,\n id,\n name,\n value\nFROM \n(\n SELECT \n date,\n id,\n name,\n value\n FROM test_00597\n WHERE id = 1\n UNION ALL\n SELECT \n date,\n id,\n name,\n value\n FROM test_00597\n WHERE id = 1\n)\nWHERE id = 1
|
||||
SELECT
|
||||
date,
|
||||
id,
|
||||
name,
|
||||
value
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
date,
|
||||
id,
|
||||
name,
|
||||
value
|
||||
FROM test_00597
|
||||
WHERE id = 1
|
||||
UNION ALL
|
||||
SELECT
|
||||
date,
|
||||
id,
|
||||
name,
|
||||
value
|
||||
FROM test_00597
|
||||
WHERE id = 1
|
||||
)
|
||||
WHERE id = 1
|
||||
2000-01-01 1 test string 1 1
|
||||
2000-01-01 1 test string 1 1
|
||||
SELECT \n date,\n id,\n name,\n value,\n date,\n name,\n value\nFROM \n(\n SELECT \n date,\n id,\n name,\n value\n FROM test_00597\n WHERE id = 1\n)\nANY LEFT JOIN \n(\n SELECT id\n FROM test_00597\n) USING (id)\nWHERE id = 1
|
||||
SELECT
|
||||
date,
|
||||
id,
|
||||
name,
|
||||
value,
|
||||
date,
|
||||
name,
|
||||
value
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
date,
|
||||
id,
|
||||
name,
|
||||
value
|
||||
FROM test_00597
|
||||
WHERE id = 1
|
||||
)
|
||||
ANY LEFT JOIN
|
||||
(
|
||||
SELECT id
|
||||
FROM test_00597
|
||||
) USING (id)
|
||||
WHERE id = 1
|
||||
2000-01-01 1 test string 1 1 2000-01-01 test string 1 1
|
||||
SELECT \n id,\n date,\n name,\n value\nFROM \n(\n SELECT toInt8(1) AS id\n)\nANY LEFT JOIN \n(\n SELECT \n date,\n id,\n name,\n value\n FROM test_00597\n) AS test_00597 USING (id)\nWHERE value = 1
|
||||
SELECT
|
||||
id,
|
||||
date,
|
||||
name,
|
||||
value
|
||||
FROM
|
||||
(
|
||||
SELECT toInt8(1) AS id
|
||||
)
|
||||
ANY LEFT JOIN
|
||||
(
|
||||
SELECT
|
||||
date,
|
||||
id,
|
||||
name,
|
||||
value
|
||||
FROM test_00597
|
||||
) AS test_00597 USING (id)
|
||||
WHERE value = 1
|
||||
1 2000-01-01 test string 1 1
|
||||
SELECT value\nFROM \n(\n SELECT toInt8(1) AS id\n)\nANY LEFT JOIN test_00597 AS b USING (id)\nWHERE value = 1
|
||||
SELECT value
|
||||
FROM
|
||||
(
|
||||
SELECT toInt8(1) AS id
|
||||
)
|
||||
ANY LEFT JOIN test_00597 AS b USING (id)
|
||||
WHERE value = 1
|
||||
1
|
||||
SELECT \n date,\n id,\n name,\n value\nFROM \n(\n SELECT \n date,\n id,\n name,\n value,\n date,\n name,\n value\n FROM \n (\n SELECT \n date,\n id,\n name,\n value\n FROM test_00597\n WHERE id = 1\n )\n ANY LEFT JOIN \n (\n SELECT id\n FROM test_00597\n ) USING (id)\n WHERE id = 1\n)\nWHERE id = 1
|
||||
SELECT
|
||||
date,
|
||||
id,
|
||||
name,
|
||||
value
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
date,
|
||||
id,
|
||||
name,
|
||||
value,
|
||||
date,
|
||||
name,
|
||||
value
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
date,
|
||||
id,
|
||||
name,
|
||||
value
|
||||
FROM test_00597
|
||||
WHERE id = 1
|
||||
)
|
||||
ANY LEFT JOIN
|
||||
(
|
||||
SELECT id
|
||||
FROM test_00597
|
||||
) USING (id)
|
||||
WHERE id = 1
|
||||
)
|
||||
WHERE id = 1
|
||||
2000-01-01 1 test string 1 1
|
||||
SELECT \n date,\n id,\n name,\n value,\n b.date,\n b.name,\n b.value\nFROM \n(\n SELECT \n date,\n id,\n name,\n value\n FROM test_00597\n)\nANY LEFT JOIN \n(\n SELECT \n date,\n id,\n name,\n value\n FROM test_00597\n) AS b USING (id)\nWHERE b.id = 1
|
||||
SELECT
|
||||
date,
|
||||
id,
|
||||
name,
|
||||
value,
|
||||
b.date,
|
||||
b.name,
|
||||
b.value
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
date,
|
||||
id,
|
||||
name,
|
||||
value
|
||||
FROM test_00597
|
||||
)
|
||||
ANY LEFT JOIN
|
||||
(
|
||||
SELECT
|
||||
date,
|
||||
id,
|
||||
name,
|
||||
value
|
||||
FROM test_00597
|
||||
) AS b USING (id)
|
||||
WHERE b.id = 1
|
||||
2000-01-01 1 test string 1 1 2000-01-01 test string 1 1
|
||||
SELECT \n id,\n date,\n name,\n value\nFROM \n(\n SELECT \n toInt8(1) AS id,\n toDate(\'2000-01-01\') AS date\n FROM system.numbers\n LIMIT 1\n)\nANY LEFT JOIN \n(\n SELECT \n date,\n id,\n name,\n value\n FROM test_00597\n) AS b USING (date, id)\nWHERE b.date = toDate(\'2000-01-01\')
|
||||
SELECT
|
||||
id,
|
||||
date,
|
||||
name,
|
||||
value
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
toInt8(1) AS id,
|
||||
toDate(\'2000-01-01\') AS date
|
||||
FROM system.numbers
|
||||
LIMIT 1
|
||||
)
|
||||
ANY LEFT JOIN
|
||||
(
|
||||
SELECT
|
||||
date,
|
||||
id,
|
||||
name,
|
||||
value
|
||||
FROM test_00597
|
||||
) AS b USING (date, id)
|
||||
WHERE b.date = toDate(\'2000-01-01\')
|
||||
1 2000-01-01 test string 1 1
|
||||
SELECT \n date,\n id,\n name,\n value,\n `b.date`,\n `b.id`,\n `b.name`,\n `b.value`\nFROM \n(\n SELECT \n date,\n id,\n name,\n value,\n b.date,\n b.id,\n b.name,\n b.value\n FROM \n (\n SELECT \n date,\n id,\n name,\n value\n FROM test_00597\n WHERE id = 1\n ) AS a\n ANY LEFT JOIN \n (\n SELECT \n date,\n id,\n name,\n value\n FROM test_00597\n ) AS b ON id = b.id\n WHERE id = 1\n)\nWHERE id = 1
|
||||
SELECT
|
||||
date,
|
||||
id,
|
||||
name,
|
||||
value,
|
||||
`b.date`,
|
||||
`b.id`,
|
||||
`b.name`,
|
||||
`b.value`
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
date,
|
||||
id,
|
||||
name,
|
||||
value,
|
||||
b.date,
|
||||
b.id,
|
||||
b.name,
|
||||
b.value
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
date,
|
||||
id,
|
||||
name,
|
||||
value
|
||||
FROM test_00597
|
||||
WHERE id = 1
|
||||
) AS a
|
||||
ANY LEFT JOIN
|
||||
(
|
||||
SELECT
|
||||
date,
|
||||
id,
|
||||
name,
|
||||
value
|
||||
FROM test_00597
|
||||
) AS b ON id = b.id
|
||||
WHERE id = 1
|
||||
)
|
||||
WHERE id = 1
|
||||
2000-01-01 1 test string 1 1 2000-01-01 1 test string 1 1
|
||||
SELECT \n date,\n id,\n name,\n value,\n r.date,\n r.name,\n r.value\nFROM \n(\n SELECT \n date,\n id,\n name,\n value\n FROM test_00597\n)\nSEMI LEFT JOIN \n(\n SELECT \n date,\n id,\n name,\n value\n FROM \n (\n SELECT \n date,\n id,\n name,\n value\n FROM test_00597\n WHERE id = 1\n )\n WHERE id = 1\n) AS r USING (id)\nWHERE r.id = 1
|
||||
SELECT
|
||||
date,
|
||||
id,
|
||||
name,
|
||||
value,
|
||||
r.date,
|
||||
r.name,
|
||||
r.value
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
date,
|
||||
id,
|
||||
name,
|
||||
value
|
||||
FROM test_00597
|
||||
)
|
||||
SEMI LEFT JOIN
|
||||
(
|
||||
SELECT
|
||||
date,
|
||||
id,
|
||||
name,
|
||||
value
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
date,
|
||||
id,
|
||||
name,
|
||||
value
|
||||
FROM test_00597
|
||||
WHERE id = 1
|
||||
)
|
||||
WHERE id = 1
|
||||
) AS r USING (id)
|
||||
WHERE r.id = 1
|
||||
2000-01-01 1 test string 1 1 2000-01-01 test string 1 1
|
||||
|
@ -35,18 +35,74 @@ comma nullable
|
||||
1 1 1 1
|
||||
2 2 1 2
|
||||
cross
|
||||
SELECT \n a,\n b,\n t2_00826.a,\n t2_00826.b\nFROM t1_00826\nALL INNER JOIN t2_00826 ON a = t2_00826.a\nWHERE a = t2_00826.a
|
||||
SELECT
|
||||
a,
|
||||
b,
|
||||
t2_00826.a,
|
||||
t2_00826.b
|
||||
FROM t1_00826
|
||||
ALL INNER JOIN t2_00826 ON a = t2_00826.a
|
||||
WHERE a = t2_00826.a
|
||||
cross nullable
|
||||
SELECT \n a,\n b,\n t2_00826.a,\n t2_00826.b\nFROM t1_00826\nALL INNER JOIN t2_00826 ON a = t2_00826.a\nWHERE a = t2_00826.a
|
||||
SELECT
|
||||
a,
|
||||
b,
|
||||
t2_00826.a,
|
||||
t2_00826.b
|
||||
FROM t1_00826
|
||||
ALL INNER JOIN t2_00826 ON a = t2_00826.a
|
||||
WHERE a = t2_00826.a
|
||||
cross nullable vs not nullable
|
||||
SELECT \n a,\n b,\n t2_00826.a,\n t2_00826.b\nFROM t1_00826\nALL INNER JOIN t2_00826 ON a = t2_00826.b\nWHERE a = t2_00826.b
|
||||
SELECT
|
||||
a,
|
||||
b,
|
||||
t2_00826.a,
|
||||
t2_00826.b
|
||||
FROM t1_00826
|
||||
ALL INNER JOIN t2_00826 ON a = t2_00826.b
|
||||
WHERE a = t2_00826.b
|
||||
cross self
|
||||
SELECT \n a,\n b,\n y.a,\n y.b\nFROM t1_00826 AS x\nALL INNER JOIN t1_00826 AS y ON (a = y.a) AND (b = y.b)\nWHERE (a = y.a) AND (b = y.b)
|
||||
SELECT
|
||||
a,
|
||||
b,
|
||||
y.a,
|
||||
y.b
|
||||
FROM t1_00826 AS x
|
||||
ALL INNER JOIN t1_00826 AS y ON (a = y.a) AND (b = y.b)
|
||||
WHERE (a = y.a) AND (b = y.b)
|
||||
cross one table expr
|
||||
SELECT \n a,\n b,\n t2_00826.a,\n t2_00826.b\nFROM t1_00826\nCROSS JOIN t2_00826\nWHERE a = b
|
||||
SELECT
|
||||
a,
|
||||
b,
|
||||
t2_00826.a,
|
||||
t2_00826.b
|
||||
FROM t1_00826
|
||||
CROSS JOIN t2_00826
|
||||
WHERE a = b
|
||||
cross multiple ands
|
||||
SELECT \n a,\n b,\n t2_00826.a,\n t2_00826.b\nFROM t1_00826\nALL INNER JOIN t2_00826 ON (a = t2_00826.a) AND (b = t2_00826.b)\nWHERE (a = t2_00826.a) AND (b = t2_00826.b)
|
||||
SELECT
|
||||
a,
|
||||
b,
|
||||
t2_00826.a,
|
||||
t2_00826.b
|
||||
FROM t1_00826
|
||||
ALL INNER JOIN t2_00826 ON (a = t2_00826.a) AND (b = t2_00826.b)
|
||||
WHERE (a = t2_00826.a) AND (b = t2_00826.b)
|
||||
cross and inside and
|
||||
SELECT \n a,\n b,\n t2_00826.a,\n t2_00826.b\nFROM t1_00826\nALL INNER JOIN t2_00826 ON (a = t2_00826.a) AND (a = t2_00826.a) AND (a = t2_00826.a) AND (b = t2_00826.b)\nWHERE (a = t2_00826.a) AND ((a = t2_00826.a) AND ((a = t2_00826.a) AND (b = t2_00826.b)))
|
||||
SELECT
|
||||
a,
|
||||
b,
|
||||
t2_00826.a,
|
||||
t2_00826.b
|
||||
FROM t1_00826
|
||||
ALL INNER JOIN t2_00826 ON (a = t2_00826.a) AND (a = t2_00826.a) AND (a = t2_00826.a) AND (b = t2_00826.b)
|
||||
WHERE (a = t2_00826.a) AND ((a = t2_00826.a) AND ((a = t2_00826.a) AND (b = t2_00826.b)))
|
||||
cross split conjunction
|
||||
SELECT \n a,\n b,\n t2_00826.a,\n t2_00826.b\nFROM t1_00826\nALL INNER JOIN t2_00826 ON (a = t2_00826.a) AND (b = t2_00826.b)\nWHERE (a = t2_00826.a) AND (b = t2_00826.b) AND (a >= 1) AND (t2_00826.b > 0)
|
||||
SELECT
|
||||
a,
|
||||
b,
|
||||
t2_00826.a,
|
||||
t2_00826.b
|
||||
FROM t1_00826
|
||||
ALL INNER JOIN t2_00826 ON (a = t2_00826.a) AND (b = t2_00826.b)
|
||||
WHERE (a = t2_00826.a) AND (b = t2_00826.b) AND (a >= 1) AND (t2_00826.b > 0)
|
||||
|
@ -1,18 +1,254 @@
|
||||
SELECT a\nFROM t1_00849\nCROSS JOIN t2_00849
|
||||
SELECT a\nFROM t1_00849\nALL INNER JOIN t2_00849 ON a = t2_00849.a\nWHERE a = t2_00849.a
|
||||
SELECT a\nFROM t1_00849\nALL INNER JOIN t2_00849 ON b = t2_00849.b\nWHERE b = t2_00849.b
|
||||
SELECT `--t1_00849.a` AS `t1_00849.a`\nFROM \n(\n SELECT \n a AS `--t1_00849.a`,\n b,\n t2_00849.a AS `--t2_00849.a`,\n t2_00849.b\n FROM t1_00849\n ALL INNER JOIN t2_00849 ON `--t1_00849.a` = `--t2_00849.a`\n) AS `--.s`\nALL INNER JOIN t3_00849 ON `--t1_00849.a` = a\nWHERE (`--t1_00849.a` = `--t2_00849.a`) AND (`--t1_00849.a` = a)
|
||||
SELECT `--t1_00849.a` AS `t1_00849.a`\nFROM \n(\n SELECT \n a AS `--t1_00849.a`,\n b AS `--t1_00849.b`,\n t2_00849.a,\n t2_00849.b AS `--t2_00849.b`\n FROM t1_00849\n ALL INNER JOIN t2_00849 ON `--t1_00849.b` = `--t2_00849.b`\n) AS `--.s`\nALL INNER JOIN t3_00849 ON `--t1_00849.b` = b\nWHERE (`--t1_00849.b` = `--t2_00849.b`) AND (`--t1_00849.b` = b)
|
||||
SELECT `--t1_00849.a` AS `t1_00849.a`\nFROM \n(\n SELECT \n `--t1_00849.a`,\n b,\n `--t2_00849.a`,\n `t2_00849.b`,\n a AS `--t3_00849.a`,\n t3_00849.b\n FROM \n (\n SELECT \n a AS `--t1_00849.a`,\n b,\n t2_00849.a AS `--t2_00849.a`,\n t2_00849.b\n FROM t1_00849\n ALL INNER JOIN t2_00849 ON `--t1_00849.a` = `--t2_00849.a`\n ) AS `--.s`\n ALL INNER JOIN t3_00849 ON `--t1_00849.a` = `--t3_00849.a`\n) AS `--.s`\nALL INNER JOIN t4_00849 ON `--t1_00849.a` = a\nWHERE (`--t1_00849.a` = `--t2_00849.a`) AND (`--t1_00849.a` = `--t3_00849.a`) AND (`--t1_00849.a` = a)
|
||||
SELECT `--t1_00849.a` AS `t1_00849.a`\nFROM \n(\n SELECT \n `--t1_00849.a`,\n `--t1_00849.b`,\n `t2_00849.a`,\n `--t2_00849.b`,\n a,\n b AS `--t3_00849.b`\n FROM \n (\n SELECT \n a AS `--t1_00849.a`,\n b AS `--t1_00849.b`,\n t2_00849.a,\n t2_00849.b AS `--t2_00849.b`\n FROM t1_00849\n ALL INNER JOIN t2_00849 ON `--t1_00849.b` = `--t2_00849.b`\n ) AS `--.s`\n ALL INNER JOIN t3_00849 ON `--t1_00849.b` = `--t3_00849.b`\n) AS `--.s`\nALL INNER JOIN t4_00849 ON `--t1_00849.b` = b\nWHERE (`--t1_00849.b` = `--t2_00849.b`) AND (`--t1_00849.b` = `--t3_00849.b`) AND (`--t1_00849.b` = b)
|
||||
SELECT `--t1_00849.a` AS `t1_00849.a`\nFROM \n(\n SELECT \n `--t1_00849.a`,\n b,\n `--t2_00849.a`,\n `t2_00849.b`,\n a AS `--t3_00849.a`,\n t3_00849.b\n FROM \n (\n SELECT \n a AS `--t1_00849.a`,\n b,\n t2_00849.a AS `--t2_00849.a`,\n t2_00849.b\n FROM t1_00849\n ALL INNER JOIN t2_00849 ON `--t2_00849.a` = `--t1_00849.a`\n ) AS `--.s`\n ALL INNER JOIN t3_00849 ON `--t2_00849.a` = `--t3_00849.a`\n) AS `--.s`\nALL INNER JOIN t4_00849 ON `--t2_00849.a` = a\nWHERE (`--t2_00849.a` = `--t1_00849.a`) AND (`--t2_00849.a` = `--t3_00849.a`) AND (`--t2_00849.a` = a)
|
||||
SELECT `--t1_00849.a` AS `t1_00849.a`\nFROM \n(\n SELECT \n `--t1_00849.a`,\n b,\n `--t2_00849.a`,\n `t2_00849.b`,\n a AS `--t3_00849.a`,\n t3_00849.b\n FROM \n (\n SELECT \n a AS `--t1_00849.a`,\n b,\n t2_00849.a AS `--t2_00849.a`,\n t2_00849.b\n FROM t1_00849\n CROSS JOIN t2_00849\n ) AS `--.s`\n ALL INNER JOIN t3_00849 ON (`--t3_00849.a` = `--t1_00849.a`) AND (`--t3_00849.a` = `--t2_00849.a`)\n) AS `--.s`\nALL INNER JOIN t4_00849 ON `--t3_00849.a` = a\nWHERE (`--t3_00849.a` = `--t1_00849.a`) AND (`--t3_00849.a` = `--t2_00849.a`) AND (`--t3_00849.a` = a)
|
||||
SELECT `--t1_00849.a` AS `t1_00849.a`\nFROM \n(\n SELECT \n `--t1_00849.a`,\n b,\n `--t2_00849.a`,\n `t2_00849.b`,\n a AS `--t3_00849.a`,\n t3_00849.b\n FROM \n (\n SELECT \n a AS `--t1_00849.a`,\n b,\n t2_00849.a AS `--t2_00849.a`,\n t2_00849.b\n FROM t1_00849\n CROSS JOIN t2_00849\n ) AS `--.s`\n CROSS JOIN t3_00849\n) AS `--.s`\nALL INNER JOIN t4_00849 ON (a = `--t1_00849.a`) AND (a = `--t2_00849.a`) AND (a = `--t3_00849.a`)\nWHERE (a = `--t1_00849.a`) AND (a = `--t2_00849.a`) AND (a = `--t3_00849.a`)
|
||||
SELECT `--t1_00849.a` AS `t1_00849.a`\nFROM \n(\n SELECT \n `--t1_00849.a`,\n b,\n `--t2_00849.a`,\n `t2_00849.b`,\n a AS `--t3_00849.a`,\n t3_00849.b\n FROM \n (\n SELECT \n a AS `--t1_00849.a`,\n b,\n t2_00849.a AS `--t2_00849.a`,\n t2_00849.b\n FROM t1_00849\n ALL INNER JOIN t2_00849 ON `--t1_00849.a` = `--t2_00849.a`\n ) AS `--.s`\n ALL INNER JOIN t3_00849 ON `--t2_00849.a` = `--t3_00849.a`\n) AS `--.s`\nALL INNER JOIN t4_00849 ON `--t3_00849.a` = a\nWHERE (`--t1_00849.a` = `--t2_00849.a`) AND (`--t2_00849.a` = `--t3_00849.a`) AND (`--t3_00849.a` = a)
|
||||
SELECT `--t1_00849.a` AS `t1_00849.a`\nFROM \n(\n SELECT \n `--t1_00849.a`,\n b,\n `t2_00849.a`,\n `t2_00849.b`,\n a,\n t3_00849.b\n FROM \n (\n SELECT \n a AS `--t1_00849.a`,\n b,\n t2_00849.a,\n t2_00849.b\n FROM t1_00849\n CROSS JOIN t2_00849\n ) AS `--.s`\n CROSS JOIN t3_00849\n) AS `--.s`\nCROSS JOIN t4_00849
|
||||
SELECT `--t1_00849.a` AS `t1_00849.a`\nFROM \n(\n SELECT \n `--t1_00849.a`,\n b,\n `t2_00849.a`,\n `t2_00849.b`,\n a,\n t3_00849.b\n FROM \n (\n SELECT \n a AS `--t1_00849.a`,\n b,\n t2_00849.a,\n t2_00849.b\n FROM t1_00849\n CROSS JOIN t2_00849\n ) AS `--.s`\n CROSS JOIN t3_00849\n) AS `--.s`\nCROSS JOIN t4_00849
|
||||
SELECT `--t1_00849.a` AS `t1_00849.a`\nFROM \n(\n SELECT \n a AS `--t1_00849.a`,\n b,\n t2_00849.a,\n t2_00849.b\n FROM t1_00849\n CROSS JOIN t2_00849\n) AS `--.s`\nCROSS JOIN t3_00849
|
||||
SELECT `--t1_00849.a` AS `t1_00849.a`\nFROM \n(\n SELECT \n a AS `--t1_00849.a`,\n b,\n t2_00849.a AS `--t2_00849.a`,\n t2_00849.b\n FROM t1_00849\n ALL INNER JOIN t2_00849 ON `--t1_00849.a` = `--t2_00849.a`\n) AS `--.s`\nCROSS JOIN t3_00849
|
||||
SELECT a
|
||||
FROM t1_00849
|
||||
CROSS JOIN t2_00849
|
||||
SELECT a
|
||||
FROM t1_00849
|
||||
ALL INNER JOIN t2_00849 ON a = t2_00849.a
|
||||
WHERE a = t2_00849.a
|
||||
SELECT a
|
||||
FROM t1_00849
|
||||
ALL INNER JOIN t2_00849 ON b = t2_00849.b
|
||||
WHERE b = t2_00849.b
|
||||
SELECT `--t1_00849.a` AS `t1_00849.a`
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
a AS `--t1_00849.a`,
|
||||
b,
|
||||
t2_00849.a AS `--t2_00849.a`,
|
||||
t2_00849.b
|
||||
FROM t1_00849
|
||||
ALL INNER JOIN t2_00849 ON `--t1_00849.a` = `--t2_00849.a`
|
||||
) AS `--.s`
|
||||
ALL INNER JOIN t3_00849 ON `--t1_00849.a` = a
|
||||
WHERE (`--t1_00849.a` = `--t2_00849.a`) AND (`--t1_00849.a` = a)
|
||||
SELECT `--t1_00849.a` AS `t1_00849.a`
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
a AS `--t1_00849.a`,
|
||||
b AS `--t1_00849.b`,
|
||||
t2_00849.a,
|
||||
t2_00849.b AS `--t2_00849.b`
|
||||
FROM t1_00849
|
||||
ALL INNER JOIN t2_00849 ON `--t1_00849.b` = `--t2_00849.b`
|
||||
) AS `--.s`
|
||||
ALL INNER JOIN t3_00849 ON `--t1_00849.b` = b
|
||||
WHERE (`--t1_00849.b` = `--t2_00849.b`) AND (`--t1_00849.b` = b)
|
||||
SELECT `--t1_00849.a` AS `t1_00849.a`
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
`--t1_00849.a`,
|
||||
b,
|
||||
`--t2_00849.a`,
|
||||
`t2_00849.b`,
|
||||
a AS `--t3_00849.a`,
|
||||
t3_00849.b
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
a AS `--t1_00849.a`,
|
||||
b,
|
||||
t2_00849.a AS `--t2_00849.a`,
|
||||
t2_00849.b
|
||||
FROM t1_00849
|
||||
ALL INNER JOIN t2_00849 ON `--t1_00849.a` = `--t2_00849.a`
|
||||
) AS `--.s`
|
||||
ALL INNER JOIN t3_00849 ON `--t1_00849.a` = `--t3_00849.a`
|
||||
) AS `--.s`
|
||||
ALL INNER JOIN t4_00849 ON `--t1_00849.a` = a
|
||||
WHERE (`--t1_00849.a` = `--t2_00849.a`) AND (`--t1_00849.a` = `--t3_00849.a`) AND (`--t1_00849.a` = a)
|
||||
SELECT `--t1_00849.a` AS `t1_00849.a`
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
`--t1_00849.a`,
|
||||
`--t1_00849.b`,
|
||||
`t2_00849.a`,
|
||||
`--t2_00849.b`,
|
||||
a,
|
||||
b AS `--t3_00849.b`
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
a AS `--t1_00849.a`,
|
||||
b AS `--t1_00849.b`,
|
||||
t2_00849.a,
|
||||
t2_00849.b AS `--t2_00849.b`
|
||||
FROM t1_00849
|
||||
ALL INNER JOIN t2_00849 ON `--t1_00849.b` = `--t2_00849.b`
|
||||
) AS `--.s`
|
||||
ALL INNER JOIN t3_00849 ON `--t1_00849.b` = `--t3_00849.b`
|
||||
) AS `--.s`
|
||||
ALL INNER JOIN t4_00849 ON `--t1_00849.b` = b
|
||||
WHERE (`--t1_00849.b` = `--t2_00849.b`) AND (`--t1_00849.b` = `--t3_00849.b`) AND (`--t1_00849.b` = b)
|
||||
SELECT `--t1_00849.a` AS `t1_00849.a`
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
`--t1_00849.a`,
|
||||
b,
|
||||
`--t2_00849.a`,
|
||||
`t2_00849.b`,
|
||||
a AS `--t3_00849.a`,
|
||||
t3_00849.b
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
a AS `--t1_00849.a`,
|
||||
b,
|
||||
t2_00849.a AS `--t2_00849.a`,
|
||||
t2_00849.b
|
||||
FROM t1_00849
|
||||
ALL INNER JOIN t2_00849 ON `--t2_00849.a` = `--t1_00849.a`
|
||||
) AS `--.s`
|
||||
ALL INNER JOIN t3_00849 ON `--t2_00849.a` = `--t3_00849.a`
|
||||
) AS `--.s`
|
||||
ALL INNER JOIN t4_00849 ON `--t2_00849.a` = a
|
||||
WHERE (`--t2_00849.a` = `--t1_00849.a`) AND (`--t2_00849.a` = `--t3_00849.a`) AND (`--t2_00849.a` = a)
|
||||
SELECT `--t1_00849.a` AS `t1_00849.a`
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
`--t1_00849.a`,
|
||||
b,
|
||||
`--t2_00849.a`,
|
||||
`t2_00849.b`,
|
||||
a AS `--t3_00849.a`,
|
||||
t3_00849.b
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
a AS `--t1_00849.a`,
|
||||
b,
|
||||
t2_00849.a AS `--t2_00849.a`,
|
||||
t2_00849.b
|
||||
FROM t1_00849
|
||||
CROSS JOIN t2_00849
|
||||
) AS `--.s`
|
||||
ALL INNER JOIN t3_00849 ON (`--t3_00849.a` = `--t1_00849.a`) AND (`--t3_00849.a` = `--t2_00849.a`)
|
||||
) AS `--.s`
|
||||
ALL INNER JOIN t4_00849 ON `--t3_00849.a` = a
|
||||
WHERE (`--t3_00849.a` = `--t1_00849.a`) AND (`--t3_00849.a` = `--t2_00849.a`) AND (`--t3_00849.a` = a)
|
||||
SELECT `--t1_00849.a` AS `t1_00849.a`
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
`--t1_00849.a`,
|
||||
b,
|
||||
`--t2_00849.a`,
|
||||
`t2_00849.b`,
|
||||
a AS `--t3_00849.a`,
|
||||
t3_00849.b
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
a AS `--t1_00849.a`,
|
||||
b,
|
||||
t2_00849.a AS `--t2_00849.a`,
|
||||
t2_00849.b
|
||||
FROM t1_00849
|
||||
CROSS JOIN t2_00849
|
||||
) AS `--.s`
|
||||
CROSS JOIN t3_00849
|
||||
) AS `--.s`
|
||||
ALL INNER JOIN t4_00849 ON (a = `--t1_00849.a`) AND (a = `--t2_00849.a`) AND (a = `--t3_00849.a`)
|
||||
WHERE (a = `--t1_00849.a`) AND (a = `--t2_00849.a`) AND (a = `--t3_00849.a`)
|
||||
SELECT `--t1_00849.a` AS `t1_00849.a`
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
`--t1_00849.a`,
|
||||
b,
|
||||
`--t2_00849.a`,
|
||||
`t2_00849.b`,
|
||||
a AS `--t3_00849.a`,
|
||||
t3_00849.b
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
a AS `--t1_00849.a`,
|
||||
b,
|
||||
t2_00849.a AS `--t2_00849.a`,
|
||||
t2_00849.b
|
||||
FROM t1_00849
|
||||
ALL INNER JOIN t2_00849 ON `--t1_00849.a` = `--t2_00849.a`
|
||||
) AS `--.s`
|
||||
ALL INNER JOIN t3_00849 ON `--t2_00849.a` = `--t3_00849.a`
|
||||
) AS `--.s`
|
||||
ALL INNER JOIN t4_00849 ON `--t3_00849.a` = a
|
||||
WHERE (`--t1_00849.a` = `--t2_00849.a`) AND (`--t2_00849.a` = `--t3_00849.a`) AND (`--t3_00849.a` = a)
|
||||
SELECT `--t1_00849.a` AS `t1_00849.a`
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
`--t1_00849.a`,
|
||||
b,
|
||||
`t2_00849.a`,
|
||||
`t2_00849.b`,
|
||||
a,
|
||||
t3_00849.b
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
a AS `--t1_00849.a`,
|
||||
b,
|
||||
t2_00849.a,
|
||||
t2_00849.b
|
||||
FROM t1_00849
|
||||
CROSS JOIN t2_00849
|
||||
) AS `--.s`
|
||||
CROSS JOIN t3_00849
|
||||
) AS `--.s`
|
||||
CROSS JOIN t4_00849
|
||||
SELECT `--t1_00849.a` AS `t1_00849.a`
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
`--t1_00849.a`,
|
||||
b,
|
||||
`t2_00849.a`,
|
||||
`t2_00849.b`,
|
||||
a,
|
||||
t3_00849.b
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
a AS `--t1_00849.a`,
|
||||
b,
|
||||
t2_00849.a,
|
||||
t2_00849.b
|
||||
FROM t1_00849
|
||||
CROSS JOIN t2_00849
|
||||
) AS `--.s`
|
||||
CROSS JOIN t3_00849
|
||||
) AS `--.s`
|
||||
CROSS JOIN t4_00849
|
||||
SELECT `--t1_00849.a` AS `t1_00849.a`
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
a AS `--t1_00849.a`,
|
||||
b,
|
||||
t2_00849.a,
|
||||
t2_00849.b
|
||||
FROM t1_00849
|
||||
CROSS JOIN t2_00849
|
||||
) AS `--.s`
|
||||
CROSS JOIN t3_00849
|
||||
SELECT `--t1_00849.a` AS `t1_00849.a`
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
a AS `--t1_00849.a`,
|
||||
b,
|
||||
t2_00849.a AS `--t2_00849.a`,
|
||||
t2_00849.b
|
||||
FROM t1_00849
|
||||
ALL INNER JOIN t2_00849 ON `--t1_00849.a` = `--t2_00849.a`
|
||||
) AS `--.s`
|
||||
CROSS JOIN t3_00849
|
||||
SELECT * FROM t1, t2
|
||||
1 1 1 1
|
||||
1 1 1 \N
|
||||
|
@ -1,18 +1,197 @@
|
||||
SELECT a\nFROM t1\nCROSS JOIN t2
|
||||
SELECT a\nFROM t1\nALL INNER JOIN t2 ON a = t2.a\nWHERE a = t2.a
|
||||
SELECT a\nFROM t1\nALL INNER JOIN t2 ON b = t2.b\nWHERE b = t2.b
|
||||
SELECT `--t1.a` AS `t1.a`\nFROM \n(\n SELECT \n a AS `--t1.a`,\n t2.a AS `--t2.a`\n FROM t1\n ALL INNER JOIN t2 ON `--t1.a` = `--t2.a`\n) AS `--.s`\nALL INNER JOIN t3 ON `--t1.a` = a\nWHERE (`--t1.a` = `--t2.a`) AND (`--t1.a` = a)
|
||||
SELECT `--t1.a` AS `t1.a`\nFROM \n(\n SELECT \n b AS `--t1.b`,\n a AS `--t1.a`,\n t2.b AS `--t2.b`\n FROM t1\n ALL INNER JOIN t2 ON `--t1.b` = `--t2.b`\n) AS `--.s`\nALL INNER JOIN t3 ON `--t1.b` = b\nWHERE (`--t1.b` = `--t2.b`) AND (`--t1.b` = b)
|
||||
SELECT `--t1.a` AS `t1.a`\nFROM \n(\n SELECT \n `--t1.a`,\n `--t2.a`,\n a AS `--t3.a`\n FROM \n (\n SELECT \n a AS `--t1.a`,\n t2.a AS `--t2.a`\n FROM t1\n ALL INNER JOIN t2 ON `--t1.a` = `--t2.a`\n ) AS `--.s`\n ALL INNER JOIN t3 ON `--t1.a` = `--t3.a`\n) AS `--.s`\nALL INNER JOIN t4 ON `--t1.a` = a\nWHERE (`--t1.a` = `--t2.a`) AND (`--t1.a` = `--t3.a`) AND (`--t1.a` = a)
|
||||
SELECT `--t1.a` AS `t1.a`\nFROM \n(\n SELECT \n `--t1.b`,\n `--t1.a`,\n `--t2.b`,\n b AS `--t3.b`\n FROM \n (\n SELECT \n b AS `--t1.b`,\n a AS `--t1.a`,\n t2.b AS `--t2.b`\n FROM t1\n ALL INNER JOIN t2 ON `--t1.b` = `--t2.b`\n ) AS `--.s`\n ALL INNER JOIN t3 ON `--t1.b` = `--t3.b`\n) AS `--.s`\nALL INNER JOIN t4 ON `--t1.b` = b\nWHERE (`--t1.b` = `--t2.b`) AND (`--t1.b` = `--t3.b`) AND (`--t1.b` = b)
|
||||
SELECT `--t1.a` AS `t1.a`\nFROM \n(\n SELECT \n `--t1.a`,\n `--t2.a`,\n a AS `--t3.a`\n FROM \n (\n SELECT \n a AS `--t1.a`,\n t2.a AS `--t2.a`\n FROM t1\n ALL INNER JOIN t2 ON `--t2.a` = `--t1.a`\n ) AS `--.s`\n ALL INNER JOIN t3 ON `--t2.a` = `--t3.a`\n) AS `--.s`\nALL INNER JOIN t4 ON `--t2.a` = a\nWHERE (`--t2.a` = `--t1.a`) AND (`--t2.a` = `--t3.a`) AND (`--t2.a` = a)
|
||||
SELECT `--t1.a` AS `t1.a`\nFROM \n(\n SELECT \n `--t1.a`,\n `--t2.a`,\n a AS `--t3.a`\n FROM \n (\n SELECT \n a AS `--t1.a`,\n t2.a AS `--t2.a`\n FROM t1\n CROSS JOIN t2\n ) AS `--.s`\n ALL INNER JOIN t3 ON (`--t3.a` = `--t1.a`) AND (`--t3.a` = `--t2.a`)\n) AS `--.s`\nALL INNER JOIN t4 ON `--t3.a` = a\nWHERE (`--t3.a` = `--t1.a`) AND (`--t3.a` = `--t2.a`) AND (`--t3.a` = a)
|
||||
SELECT `--t1.a` AS `t1.a`\nFROM \n(\n SELECT \n `--t1.a`,\n `--t2.a`,\n a AS `--t3.a`\n FROM \n (\n SELECT \n a AS `--t1.a`,\n t2.a AS `--t2.a`\n FROM t1\n CROSS JOIN t2\n ) AS `--.s`\n CROSS JOIN t3\n) AS `--.s`\nALL INNER JOIN t4 ON (a = `--t1.a`) AND (a = `--t2.a`) AND (a = `--t3.a`)\nWHERE (a = `--t1.a`) AND (a = `--t2.a`) AND (a = `--t3.a`)
|
||||
SELECT `--t1.a` AS `t1.a`\nFROM \n(\n SELECT \n `--t1.a`,\n `--t2.a`,\n a AS `--t3.a`\n FROM \n (\n SELECT \n a AS `--t1.a`,\n t2.a AS `--t2.a`\n FROM t1\n ALL INNER JOIN t2 ON `--t1.a` = `--t2.a`\n ) AS `--.s`\n ALL INNER JOIN t3 ON `--t2.a` = `--t3.a`\n) AS `--.s`\nALL INNER JOIN t4 ON `--t3.a` = a\nWHERE (`--t1.a` = `--t2.a`) AND (`--t2.a` = `--t3.a`) AND (`--t3.a` = a)
|
||||
SELECT `--t1.a` AS `t1.a`\nFROM \n(\n SELECT `--t1.a`\n FROM \n (\n SELECT a AS `--t1.a`\n FROM t1\n CROSS JOIN t2\n ) AS `--.s`\n CROSS JOIN t3\n) AS `--.s`\nCROSS JOIN t4
|
||||
SELECT `--t1.a` AS `t1.a`\nFROM \n(\n SELECT `--t1.a`\n FROM \n (\n SELECT a AS `--t1.a`\n FROM t1\n CROSS JOIN t2\n ) AS `--.s`\n CROSS JOIN t3\n) AS `--.s`\nCROSS JOIN t4
|
||||
SELECT `--t1.a` AS `t1.a`\nFROM \n(\n SELECT a AS `--t1.a`\n FROM t1\n CROSS JOIN t2\n) AS `--.s`\nCROSS JOIN t3
|
||||
SELECT `--t1.a` AS `t1.a`\nFROM \n(\n SELECT \n a AS `--t1.a`,\n t2.a AS `--t2.a`\n FROM t1\n ALL INNER JOIN t2 ON `--t1.a` = `--t2.a`\n) AS `--.s`\nCROSS JOIN t3
|
||||
SELECT a
|
||||
FROM t1
|
||||
CROSS JOIN t2
|
||||
SELECT a
|
||||
FROM t1
|
||||
ALL INNER JOIN t2 ON a = t2.a
|
||||
WHERE a = t2.a
|
||||
SELECT a
|
||||
FROM t1
|
||||
ALL INNER JOIN t2 ON b = t2.b
|
||||
WHERE b = t2.b
|
||||
SELECT `--t1.a` AS `t1.a`
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
a AS `--t1.a`,
|
||||
t2.a AS `--t2.a`
|
||||
FROM t1
|
||||
ALL INNER JOIN t2 ON `--t1.a` = `--t2.a`
|
||||
) AS `--.s`
|
||||
ALL INNER JOIN t3 ON `--t1.a` = a
|
||||
WHERE (`--t1.a` = `--t2.a`) AND (`--t1.a` = a)
|
||||
SELECT `--t1.a` AS `t1.a`
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
b AS `--t1.b`,
|
||||
a AS `--t1.a`,
|
||||
t2.b AS `--t2.b`
|
||||
FROM t1
|
||||
ALL INNER JOIN t2 ON `--t1.b` = `--t2.b`
|
||||
) AS `--.s`
|
||||
ALL INNER JOIN t3 ON `--t1.b` = b
|
||||
WHERE (`--t1.b` = `--t2.b`) AND (`--t1.b` = b)
|
||||
SELECT `--t1.a` AS `t1.a`
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
`--t1.a`,
|
||||
`--t2.a`,
|
||||
a AS `--t3.a`
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
a AS `--t1.a`,
|
||||
t2.a AS `--t2.a`
|
||||
FROM t1
|
||||
ALL INNER JOIN t2 ON `--t1.a` = `--t2.a`
|
||||
) AS `--.s`
|
||||
ALL INNER JOIN t3 ON `--t1.a` = `--t3.a`
|
||||
) AS `--.s`
|
||||
ALL INNER JOIN t4 ON `--t1.a` = a
|
||||
WHERE (`--t1.a` = `--t2.a`) AND (`--t1.a` = `--t3.a`) AND (`--t1.a` = a)
|
||||
SELECT `--t1.a` AS `t1.a`
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
`--t1.b`,
|
||||
`--t1.a`,
|
||||
`--t2.b`,
|
||||
b AS `--t3.b`
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
b AS `--t1.b`,
|
||||
a AS `--t1.a`,
|
||||
t2.b AS `--t2.b`
|
||||
FROM t1
|
||||
ALL INNER JOIN t2 ON `--t1.b` = `--t2.b`
|
||||
) AS `--.s`
|
||||
ALL INNER JOIN t3 ON `--t1.b` = `--t3.b`
|
||||
) AS `--.s`
|
||||
ALL INNER JOIN t4 ON `--t1.b` = b
|
||||
WHERE (`--t1.b` = `--t2.b`) AND (`--t1.b` = `--t3.b`) AND (`--t1.b` = b)
|
||||
SELECT `--t1.a` AS `t1.a`
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
`--t1.a`,
|
||||
`--t2.a`,
|
||||
a AS `--t3.a`
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
a AS `--t1.a`,
|
||||
t2.a AS `--t2.a`
|
||||
FROM t1
|
||||
ALL INNER JOIN t2 ON `--t2.a` = `--t1.a`
|
||||
) AS `--.s`
|
||||
ALL INNER JOIN t3 ON `--t2.a` = `--t3.a`
|
||||
) AS `--.s`
|
||||
ALL INNER JOIN t4 ON `--t2.a` = a
|
||||
WHERE (`--t2.a` = `--t1.a`) AND (`--t2.a` = `--t3.a`) AND (`--t2.a` = a)
|
||||
SELECT `--t1.a` AS `t1.a`
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
`--t1.a`,
|
||||
`--t2.a`,
|
||||
a AS `--t3.a`
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
a AS `--t1.a`,
|
||||
t2.a AS `--t2.a`
|
||||
FROM t1
|
||||
CROSS JOIN t2
|
||||
) AS `--.s`
|
||||
ALL INNER JOIN t3 ON (`--t3.a` = `--t1.a`) AND (`--t3.a` = `--t2.a`)
|
||||
) AS `--.s`
|
||||
ALL INNER JOIN t4 ON `--t3.a` = a
|
||||
WHERE (`--t3.a` = `--t1.a`) AND (`--t3.a` = `--t2.a`) AND (`--t3.a` = a)
|
||||
SELECT `--t1.a` AS `t1.a`
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
`--t1.a`,
|
||||
`--t2.a`,
|
||||
a AS `--t3.a`
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
a AS `--t1.a`,
|
||||
t2.a AS `--t2.a`
|
||||
FROM t1
|
||||
CROSS JOIN t2
|
||||
) AS `--.s`
|
||||
CROSS JOIN t3
|
||||
) AS `--.s`
|
||||
ALL INNER JOIN t4 ON (a = `--t1.a`) AND (a = `--t2.a`) AND (a = `--t3.a`)
|
||||
WHERE (a = `--t1.a`) AND (a = `--t2.a`) AND (a = `--t3.a`)
|
||||
SELECT `--t1.a` AS `t1.a`
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
`--t1.a`,
|
||||
`--t2.a`,
|
||||
a AS `--t3.a`
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
a AS `--t1.a`,
|
||||
t2.a AS `--t2.a`
|
||||
FROM t1
|
||||
ALL INNER JOIN t2 ON `--t1.a` = `--t2.a`
|
||||
) AS `--.s`
|
||||
ALL INNER JOIN t3 ON `--t2.a` = `--t3.a`
|
||||
) AS `--.s`
|
||||
ALL INNER JOIN t4 ON `--t3.a` = a
|
||||
WHERE (`--t1.a` = `--t2.a`) AND (`--t2.a` = `--t3.a`) AND (`--t3.a` = a)
|
||||
SELECT `--t1.a` AS `t1.a`
|
||||
FROM
|
||||
(
|
||||
SELECT `--t1.a`
|
||||
FROM
|
||||
(
|
||||
SELECT a AS `--t1.a`
|
||||
FROM t1
|
||||
CROSS JOIN t2
|
||||
) AS `--.s`
|
||||
CROSS JOIN t3
|
||||
) AS `--.s`
|
||||
CROSS JOIN t4
|
||||
SELECT `--t1.a` AS `t1.a`
|
||||
FROM
|
||||
(
|
||||
SELECT `--t1.a`
|
||||
FROM
|
||||
(
|
||||
SELECT a AS `--t1.a`
|
||||
FROM t1
|
||||
CROSS JOIN t2
|
||||
) AS `--.s`
|
||||
CROSS JOIN t3
|
||||
) AS `--.s`
|
||||
CROSS JOIN t4
|
||||
SELECT `--t1.a` AS `t1.a`
|
||||
FROM
|
||||
(
|
||||
SELECT a AS `--t1.a`
|
||||
FROM t1
|
||||
CROSS JOIN t2
|
||||
) AS `--.s`
|
||||
CROSS JOIN t3
|
||||
SELECT `--t1.a` AS `t1.a`
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
a AS `--t1.a`,
|
||||
t2.a AS `--t2.a`
|
||||
FROM t1
|
||||
ALL INNER JOIN t2 ON `--t1.a` = `--t2.a`
|
||||
) AS `--.s`
|
||||
CROSS JOIN t3
|
||||
SELECT * FROM t1, t2
|
||||
1 1 1 1
|
||||
1 1 1 \N
|
||||
|
@ -1 +1,4 @@
|
||||
SELECT \n a,\n b\nFROM a
|
||||
SELECT
|
||||
a,
|
||||
b
|
||||
FROM a
|
||||
|
@ -1,5 +1,12 @@
|
||||
SELECT 1\nWHERE 0
|
||||
SELECT 1
|
||||
SELECT 1\nWHERE 0
|
||||
SELECT 1\nWHERE 1 IN (\n(\n SELECT arrayJoin([1, 2, 3])\n) AS subquery)
|
||||
SELECT 1\nWHERE NOT ignore()
|
||||
WHERE 0
|
||||
SELECT 1
|
||||
SELECT 1
|
||||
WHERE 0
|
||||
SELECT 1
|
||||
WHERE 1 IN (
|
||||
(
|
||||
SELECT arrayJoin([1, 2, 3])
|
||||
) AS subquery)
|
||||
SELECT 1
|
||||
WHERE NOT ignore()
|
||||
|
@ -1,19 +1,125 @@
|
||||
SELECT \n k,\n v,\n d,\n i\nFROM \n(\n SELECT \n t.1 AS k,\n t.2 AS v,\n runningDifference(v) AS d,\n runningDifference(cityHash64(t.1)) AS i\n FROM \n (\n SELECT arrayJoin([(\'a\', 1), (\'a\', 2), (\'a\', 3), (\'b\', 11), (\'b\', 13), (\'b\', 15)]) AS t\n )\n)\nWHERE i = 0
|
||||
SELECT
|
||||
k,
|
||||
v,
|
||||
d,
|
||||
i
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
t.1 AS k,
|
||||
t.2 AS v,
|
||||
runningDifference(v) AS d,
|
||||
runningDifference(cityHash64(t.1)) AS i
|
||||
FROM
|
||||
(
|
||||
SELECT arrayJoin([(\'a\', 1), (\'a\', 2), (\'a\', 3), (\'b\', 11), (\'b\', 13), (\'b\', 15)]) AS t
|
||||
)
|
||||
)
|
||||
WHERE i = 0
|
||||
a 1 0 0
|
||||
a 2 1 0
|
||||
a 3 1 0
|
||||
b 13 2 0
|
||||
b 15 2 0
|
||||
SELECT \n co,\n co2,\n co3,\n num\nFROM \n(\n SELECT \n co,\n co2,\n co3,\n count() AS num\n FROM \n (\n SELECT \n 1 AS co,\n 2 AS co2,\n 3 AS co3\n )\n GROUP BY \n co,\n co2,\n co3\n WITH CUBE\n HAVING (co2 != 2) AND (co != 0)\n)\nWHERE (co != 0) AND (co2 != 2)
|
||||
SELECT
|
||||
co,
|
||||
co2,
|
||||
co3,
|
||||
num
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
co,
|
||||
co2,
|
||||
co3,
|
||||
count() AS num
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
1 AS co,
|
||||
2 AS co2,
|
||||
3 AS co3
|
||||
)
|
||||
GROUP BY
|
||||
co,
|
||||
co2,
|
||||
co3
|
||||
WITH CUBE
|
||||
HAVING (co2 != 2) AND (co != 0)
|
||||
)
|
||||
WHERE (co != 0) AND (co2 != 2)
|
||||
1 0 3 1
|
||||
1 0 0 1
|
||||
SELECT alias AS name\nFROM \n(\n SELECT name AS alias\n FROM system.settings\n WHERE alias = \'enable_optimize_predicate_expression\'\n)\nANY INNER JOIN \n(\n SELECT name\n FROM system.settings\n) USING (name)\nWHERE name = \'enable_optimize_predicate_expression\'
|
||||
SELECT alias AS name
|
||||
FROM
|
||||
(
|
||||
SELECT name AS alias
|
||||
FROM system.settings
|
||||
WHERE alias = \'enable_optimize_predicate_expression\'
|
||||
)
|
||||
ANY INNER JOIN
|
||||
(
|
||||
SELECT name
|
||||
FROM system.settings
|
||||
) USING (name)
|
||||
WHERE name = \'enable_optimize_predicate_expression\'
|
||||
enable_optimize_predicate_expression
|
||||
1 val11 val21 val31
|
||||
SELECT ccc\nFROM \n(\n SELECT 1 AS ccc\n WHERE 0\n UNION ALL\n SELECT ccc\n FROM \n (\n SELECT 2 AS ccc\n )\n ANY INNER JOIN \n (\n SELECT 2 AS ccc\n ) USING (ccc)\n WHERE ccc > 1\n)\nWHERE ccc > 1
|
||||
SELECT ccc
|
||||
FROM
|
||||
(
|
||||
SELECT 1 AS ccc
|
||||
WHERE 0
|
||||
UNION ALL
|
||||
SELECT ccc
|
||||
FROM
|
||||
(
|
||||
SELECT 2 AS ccc
|
||||
)
|
||||
ANY INNER JOIN
|
||||
(
|
||||
SELECT 2 AS ccc
|
||||
) USING (ccc)
|
||||
WHERE ccc > 1
|
||||
)
|
||||
WHERE ccc > 1
|
||||
2
|
||||
SELECT \n ts,\n id,\n id_b,\n b.ts,\n b.id,\n id_c\nFROM \n(\n SELECT \n ts,\n id,\n id_b\n FROM A\n WHERE ts <= toDateTime(\'1970-01-01 03:00:00\')\n) AS a\nALL LEFT JOIN B AS b ON b.id = id_b\nWHERE ts <= toDateTime(\'1970-01-01 03:00:00\')
|
||||
SELECT \n ts AS `--a.ts`,\n id AS `--a.id`,\n id_b AS `--a.id_b`,\n b.ts AS `--b.ts`,\n b.id AS `--b.id`,\n id_c AS `--b.id_c`\nFROM \n(\n SELECT \n ts,\n id,\n id_b\n FROM A\n WHERE ts <= toDateTime(\'1970-01-01 03:00:00\')\n) AS a\nALL LEFT JOIN B AS b ON `--b.id` = `--a.id_b`\nWHERE `--a.ts` <= toDateTime(\'1970-01-01 03:00:00\')
|
||||
SELECT
|
||||
ts,
|
||||
id,
|
||||
id_b,
|
||||
b.ts,
|
||||
b.id,
|
||||
id_c
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
ts,
|
||||
id,
|
||||
id_b
|
||||
FROM A
|
||||
WHERE ts <= toDateTime(\'1970-01-01 03:00:00\')
|
||||
) AS a
|
||||
ALL LEFT JOIN B AS b ON b.id = id_b
|
||||
WHERE ts <= toDateTime(\'1970-01-01 03:00:00\')
|
||||
SELECT
|
||||
ts AS `--a.ts`,
|
||||
id AS `--a.id`,
|
||||
id_b AS `--a.id_b`,
|
||||
b.ts AS `--b.ts`,
|
||||
b.id AS `--b.id`,
|
||||
id_c AS `--b.id_c`
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
ts,
|
||||
id,
|
||||
id_b
|
||||
FROM A
|
||||
WHERE ts <= toDateTime(\'1970-01-01 03:00:00\')
|
||||
) AS a
|
||||
ALL LEFT JOIN B AS b ON `--b.id` = `--a.id_b`
|
||||
WHERE `--a.ts` <= toDateTime(\'1970-01-01 03:00:00\')
|
||||
2 3
|
||||
3 4
|
||||
4 5
|
||||
@ -22,8 +128,33 @@ SELECT \n ts AS `--a.ts`,\n id AS `--a.id`,\n id_b AS `--a.id_b`,\n
|
||||
4 0
|
||||
2 3
|
||||
4 5
|
||||
SELECT dummy\nFROM \n(\n SELECT dummy\n FROM system.one\n WHERE arrayMap(x -> (x + 1), [dummy]) = [1]\n)\nWHERE arrayMap(x -> (x + 1), [dummy]) = [1]
|
||||
SELECT dummy
|
||||
FROM
|
||||
(
|
||||
SELECT dummy
|
||||
FROM system.one
|
||||
WHERE arrayMap(x -> (x + 1), [dummy]) = [1]
|
||||
)
|
||||
WHERE arrayMap(x -> (x + 1), [dummy]) = [1]
|
||||
0
|
||||
SELECT \n id,\n value,\n value_1\nFROM \n(\n SELECT \n 1 AS id,\n 2 AS value\n)\nALL INNER JOIN \n(\n SELECT \n 1 AS id,\n 3 AS value_1\n) USING (id)\nWHERE arrayMap(x -> ((x + value) + value_1), [1]) = [6]
|
||||
SELECT
|
||||
id,
|
||||
value,
|
||||
value_1
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
1 AS id,
|
||||
2 AS value
|
||||
)
|
||||
ALL INNER JOIN
|
||||
(
|
||||
SELECT
|
||||
1 AS id,
|
||||
3 AS value_1
|
||||
) USING (id)
|
||||
WHERE arrayMap(x -> ((x + value) + value_1), [1]) = [6]
|
||||
1 2 3
|
||||
SELECT dummy\nFROM system.one\nWHERE (dummy > 0) AND (dummy < 0)
|
||||
SELECT dummy
|
||||
FROM system.one
|
||||
WHERE (dummy > 0) AND (dummy < 0)
|
||||
|
@ -1,4 +1,40 @@
|
||||
SELECT \n date,\n id,\n name,\n value\nFROM \n(\n SELECT *\n FROM default.test\n HAVING id = 1\n) AS test_view\nWHERE id = 1
|
||||
SELECT \n date,\n id,\n name,\n value\nFROM \n(\n SELECT *\n FROM default.test\n HAVING id = 2\n) AS test_view\nWHERE id = 2
|
||||
SELECT id\nFROM \n(\n SELECT *\n FROM default.test\n HAVING id = 1\n) AS test_view\nWHERE id = 1
|
||||
SELECT id\nFROM \n(\n SELECT *\n FROM default.test\n HAVING id = 1\n) AS s\nWHERE id = 1
|
||||
SELECT
|
||||
date,
|
||||
id,
|
||||
name,
|
||||
value
|
||||
FROM
|
||||
(
|
||||
SELECT *
|
||||
FROM default.test
|
||||
HAVING id = 1
|
||||
) AS test_view
|
||||
WHERE id = 1
|
||||
SELECT
|
||||
date,
|
||||
id,
|
||||
name,
|
||||
value
|
||||
FROM
|
||||
(
|
||||
SELECT *
|
||||
FROM default.test
|
||||
HAVING id = 2
|
||||
) AS test_view
|
||||
WHERE id = 2
|
||||
SELECT id
|
||||
FROM
|
||||
(
|
||||
SELECT *
|
||||
FROM default.test
|
||||
HAVING id = 1
|
||||
) AS test_view
|
||||
WHERE id = 1
|
||||
SELECT id
|
||||
FROM
|
||||
(
|
||||
SELECT *
|
||||
FROM default.test
|
||||
HAVING id = 1
|
||||
) AS s
|
||||
WHERE id = 1
|
||||
|
@ -1,3 +1,21 @@
|
||||
SELECT \n k,\n r.k,\n name\nFROM n\nALL INNER JOIN r ON k = r.k\nWHERE (k = r.k) AND (name = \'A\')
|
||||
SELECT \n k,\n r.k,\n name\nFROM n\nALL INNER JOIN r ON k = r.k\nWHERE (k = r.k) AND (name LIKE \'A%\')
|
||||
SELECT \n k,\n r.k,\n name\nFROM n\nALL INNER JOIN r ON k = r.k\nWHERE (k = r.k) AND (name NOT LIKE \'A%\')
|
||||
SELECT
|
||||
k,
|
||||
r.k,
|
||||
name
|
||||
FROM n
|
||||
ALL INNER JOIN r ON k = r.k
|
||||
WHERE (k = r.k) AND (name = \'A\')
|
||||
SELECT
|
||||
k,
|
||||
r.k,
|
||||
name
|
||||
FROM n
|
||||
ALL INNER JOIN r ON k = r.k
|
||||
WHERE (k = r.k) AND (name LIKE \'A%\')
|
||||
SELECT
|
||||
k,
|
||||
r.k,
|
||||
name
|
||||
FROM n
|
||||
ALL INNER JOIN r ON k = r.k
|
||||
WHERE (k = r.k) AND (name NOT LIKE \'A%\')
|
||||
|
@ -22,11 +22,35 @@
|
||||
3465736.595946905
|
||||
3465735.2096525617
|
||||
3465735.9027997428
|
||||
SELECT max(log(2) * number) AS k\nFROM numbers(10000000)\nGROUP BY \n number % 2,\n number % 3,\n ((number % 2) + (number % 3)) % 2\nORDER BY k ASC
|
||||
SELECT avg(log(2) * number) AS k\nFROM numbers(10000000)\nGROUP BY number % 5\nORDER BY k ASC
|
||||
SELECT avg(log(2) * number) AS k\nFROM numbers(10000000)\nGROUP BY \n (number % 2) * (number % 3),\n number % 3\nORDER BY k ASC
|
||||
SELECT avg(log(2) * number) AS k\nFROM numbers(10000000)\nGROUP BY \n number % 3,\n number % 2\nORDER BY k ASC
|
||||
SELECT avg(log(2) * number) AS k\nFROM numbers(10000000)\nGROUP BY \n (number % 2) % 3,\n number % 2\nORDER BY k ASC
|
||||
SELECT max(log(2) * number) AS k
|
||||
FROM numbers(10000000)
|
||||
GROUP BY
|
||||
number % 2,
|
||||
number % 3,
|
||||
((number % 2) + (number % 3)) % 2
|
||||
ORDER BY k ASC
|
||||
SELECT avg(log(2) * number) AS k
|
||||
FROM numbers(10000000)
|
||||
GROUP BY number % 5
|
||||
ORDER BY k ASC
|
||||
SELECT avg(log(2) * number) AS k
|
||||
FROM numbers(10000000)
|
||||
GROUP BY
|
||||
(number % 2) * (number % 3),
|
||||
number % 3
|
||||
ORDER BY k ASC
|
||||
SELECT avg(log(2) * number) AS k
|
||||
FROM numbers(10000000)
|
||||
GROUP BY
|
||||
number % 3,
|
||||
number % 2
|
||||
ORDER BY k ASC
|
||||
SELECT avg(log(2) * number) AS k
|
||||
FROM numbers(10000000)
|
||||
GROUP BY
|
||||
(number % 2) % 3,
|
||||
number % 2
|
||||
ORDER BY k ASC
|
||||
6931467.646716369
|
||||
6931468.33986355
|
||||
6931469.0330107305
|
||||
@ -51,8 +75,35 @@ SELECT avg(log(2) * number) AS k\nFROM numbers(10000000)\nGROUP BY \n (number
|
||||
3465736.595946905
|
||||
3465735.2096525617
|
||||
3465735.9027997428
|
||||
SELECT max(log(2) * number) AS k\nFROM numbers(10000000)\nGROUP BY \n number % 2,\n number % 3,\n ((number % 2) + (number % 3)) % 2\nORDER BY k ASC
|
||||
SELECT avg(log(2) * number) AS k\nFROM numbers(10000000)\nGROUP BY \n number % 5,\n (number % 5) * (number % 5)\nORDER BY k ASC
|
||||
SELECT avg(log(2) * number) AS k\nFROM numbers(10000000)\nGROUP BY \n (number % 2) * (number % 3),\n number % 3\nORDER BY k ASC
|
||||
SELECT avg(log(2) * number) AS k\nFROM numbers(10000000)\nGROUP BY \n (number % 2) * (number % 3),\n number % 3,\n number % 2\nORDER BY k ASC
|
||||
SELECT avg(log(2) * number) AS k\nFROM numbers(10000000)\nGROUP BY \n (number % 2) % 3,\n number % 2\nORDER BY k ASC
|
||||
SELECT max(log(2) * number) AS k
|
||||
FROM numbers(10000000)
|
||||
GROUP BY
|
||||
number % 2,
|
||||
number % 3,
|
||||
((number % 2) + (number % 3)) % 2
|
||||
ORDER BY k ASC
|
||||
SELECT avg(log(2) * number) AS k
|
||||
FROM numbers(10000000)
|
||||
GROUP BY
|
||||
number % 5,
|
||||
(number % 5) * (number % 5)
|
||||
ORDER BY k ASC
|
||||
SELECT avg(log(2) * number) AS k
|
||||
FROM numbers(10000000)
|
||||
GROUP BY
|
||||
(number % 2) * (number % 3),
|
||||
number % 3
|
||||
ORDER BY k ASC
|
||||
SELECT avg(log(2) * number) AS k
|
||||
FROM numbers(10000000)
|
||||
GROUP BY
|
||||
(number % 2) * (number % 3),
|
||||
number % 3,
|
||||
number % 2
|
||||
ORDER BY k ASC
|
||||
SELECT avg(log(2) * number) AS k
|
||||
FROM numbers(10000000)
|
||||
GROUP BY
|
||||
(number % 2) % 3,
|
||||
number % 2
|
||||
ORDER BY k ASC
|
||||
|
@ -7,9 +7,23 @@
|
||||
0
|
||||
1
|
||||
4
|
||||
SELECT avg(log(2) * number) AS k\nFROM numbers(10000000)\nGROUP BY \n number % 3,\n number % 2\nHAVING avg(log(2) * number) > 3465735.3\nORDER BY k ASC
|
||||
SELECT avg(log(2) * number) AS k\nFROM numbers(10000000)\nWHERE ((number % 5) * (number % 5)) < 5\nGROUP BY number % 5\nORDER BY k ASC
|
||||
SELECT (number % 5) * (number % 5) AS k\nFROM numbers(10000000)\nWHERE ((number % 5) * (number % 5)) < 5\nGROUP BY number % 5\nORDER BY k ASC
|
||||
SELECT avg(log(2) * number) AS k
|
||||
FROM numbers(10000000)
|
||||
GROUP BY
|
||||
number % 3,
|
||||
number % 2
|
||||
HAVING avg(log(2) * number) > 3465735.3
|
||||
ORDER BY k ASC
|
||||
SELECT avg(log(2) * number) AS k
|
||||
FROM numbers(10000000)
|
||||
WHERE ((number % 5) * (number % 5)) < 5
|
||||
GROUP BY number % 5
|
||||
ORDER BY k ASC
|
||||
SELECT (number % 5) * (number % 5) AS k
|
||||
FROM numbers(10000000)
|
||||
WHERE ((number % 5) * (number % 5)) < 5
|
||||
GROUP BY number % 5
|
||||
ORDER BY k ASC
|
||||
3465735.9027997246
|
||||
3465735.902799725
|
||||
3465736.595946905
|
||||
@ -19,6 +33,25 @@ SELECT (number % 5) * (number % 5) AS k\nFROM numbers(10000000)\nWHERE ((number
|
||||
0
|
||||
1
|
||||
4
|
||||
SELECT avg(log(2) * number) AS k\nFROM numbers(10000000)\nGROUP BY \n (number % 2) * (number % 3),\n number % 3,\n number % 2\nHAVING avg(log(2) * number) > 3465735.3\nORDER BY k ASC
|
||||
SELECT avg(log(2) * number) AS k\nFROM numbers(10000000)\nWHERE ((number % 5) * (number % 5)) < 5\nGROUP BY \n number % 5,\n (number % 5) * (number % 5)\nORDER BY k ASC
|
||||
SELECT (number % 5) * (number % 5) AS k\nFROM numbers(10000000)\nWHERE ((number % 5) * (number % 5)) < 5\nGROUP BY \n number % 5,\n (number % 5) * (number % 5)\nORDER BY k ASC
|
||||
SELECT avg(log(2) * number) AS k
|
||||
FROM numbers(10000000)
|
||||
GROUP BY
|
||||
(number % 2) * (number % 3),
|
||||
number % 3,
|
||||
number % 2
|
||||
HAVING avg(log(2) * number) > 3465735.3
|
||||
ORDER BY k ASC
|
||||
SELECT avg(log(2) * number) AS k
|
||||
FROM numbers(10000000)
|
||||
WHERE ((number % 5) * (number % 5)) < 5
|
||||
GROUP BY
|
||||
number % 5,
|
||||
(number % 5) * (number % 5)
|
||||
ORDER BY k ASC
|
||||
SELECT (number % 5) * (number % 5) AS k
|
||||
FROM numbers(10000000)
|
||||
WHERE ((number % 5) * (number % 5)) < 5
|
||||
GROUP BY
|
||||
number % 5,
|
||||
(number % 5) * (number % 5)
|
||||
ORDER BY k ASC
|
||||
|
@ -1,14 +1,58 @@
|
||||
SELECT number\nFROM \n(\n SELECT number\n FROM \n (\n SELECT DISTINCT number\n FROM numbers(3)\n )\n)\nORDER BY number ASC
|
||||
SELECT number
|
||||
FROM
|
||||
(
|
||||
SELECT number
|
||||
FROM
|
||||
(
|
||||
SELECT DISTINCT number
|
||||
FROM numbers(3)
|
||||
)
|
||||
)
|
||||
ORDER BY number ASC
|
||||
0
|
||||
1
|
||||
2
|
||||
SELECT DISTINCT number\nFROM \n(\n SELECT DISTINCT number\n FROM \n (\n SELECT DISTINCT number\n FROM numbers(3)\n ORDER BY number ASC\n )\n ORDER BY number ASC\n)\nORDER BY number ASC
|
||||
SELECT DISTINCT number
|
||||
FROM
|
||||
(
|
||||
SELECT DISTINCT number
|
||||
FROM
|
||||
(
|
||||
SELECT DISTINCT number
|
||||
FROM numbers(3)
|
||||
ORDER BY number ASC
|
||||
)
|
||||
ORDER BY number ASC
|
||||
)
|
||||
ORDER BY number ASC
|
||||
0
|
||||
1
|
||||
2
|
||||
SELECT number\nFROM \n(\n SELECT DISTINCT number\n FROM \n (\n SELECT DISTINCT number % 2 AS number\n FROM numbers(3)\n )\n)\nORDER BY number ASC
|
||||
SELECT number
|
||||
FROM
|
||||
(
|
||||
SELECT DISTINCT number
|
||||
FROM
|
||||
(
|
||||
SELECT DISTINCT number % 2 AS number
|
||||
FROM numbers(3)
|
||||
)
|
||||
)
|
||||
ORDER BY number ASC
|
||||
0
|
||||
1
|
||||
SELECT DISTINCT number\nFROM \n(\n SELECT DISTINCT number\n FROM \n (\n SELECT DISTINCT number % 2 AS number\n FROM numbers(3)\n ORDER BY number ASC\n )\n ORDER BY number ASC\n)\nORDER BY number ASC
|
||||
SELECT DISTINCT number
|
||||
FROM
|
||||
(
|
||||
SELECT DISTINCT number
|
||||
FROM
|
||||
(
|
||||
SELECT DISTINCT number % 2 AS number
|
||||
FROM numbers(3)
|
||||
ORDER BY number ASC
|
||||
)
|
||||
ORDER BY number ASC
|
||||
)
|
||||
ORDER BY number ASC
|
||||
0
|
||||
1
|
||||
|
@ -47,10 +47,39 @@
|
||||
24
|
||||
0
|
||||
0
|
||||
SELECT \n number % 2 AS a,\n number % 3 AS b\nFROM numbers(10000000)\nGROUP BY \n number % 2,\n number % 3\nORDER BY \n min(number % 2) AS a ASC,\n max(number % 3) AS b ASC
|
||||
SELECT \n number % 2 AS a,\n number % 3 AS b\nFROM numbers(10000000)\nGROUP BY \n number % 2,\n number % 3\nORDER BY \n any(number % 2) AS a ASC,\n anyLast(number % 3) AS b ASC
|
||||
SELECT (number % 5) * (number % 7) AS a\nFROM numbers(10000000)\nGROUP BY \n number % 7,\n number % 5\nORDER BY max((number % 5) * (number % 7)) AS a ASC
|
||||
SELECT foo\nFROM \n(\n SELECT number AS foo\n FROM numbers(1)\n GROUP BY number\n)
|
||||
SELECT
|
||||
number % 2 AS a,
|
||||
number % 3 AS b
|
||||
FROM numbers(10000000)
|
||||
GROUP BY
|
||||
number % 2,
|
||||
number % 3
|
||||
ORDER BY
|
||||
min(number % 2) AS a ASC,
|
||||
max(number % 3) AS b ASC
|
||||
SELECT
|
||||
number % 2 AS a,
|
||||
number % 3 AS b
|
||||
FROM numbers(10000000)
|
||||
GROUP BY
|
||||
number % 2,
|
||||
number % 3
|
||||
ORDER BY
|
||||
any(number % 2) AS a ASC,
|
||||
anyLast(number % 3) AS b ASC
|
||||
SELECT (number % 5) * (number % 7) AS a
|
||||
FROM numbers(10000000)
|
||||
GROUP BY
|
||||
number % 7,
|
||||
number % 5
|
||||
ORDER BY max((number % 5) * (number % 7)) AS a ASC
|
||||
SELECT foo
|
||||
FROM
|
||||
(
|
||||
SELECT number AS foo
|
||||
FROM numbers(1)
|
||||
GROUP BY number
|
||||
)
|
||||
0 0
|
||||
0 1
|
||||
0 2
|
||||
@ -99,7 +128,36 @@ SELECT foo\nFROM \n(\n SELECT number AS foo\n FROM numbers(1)\n GROUP B
|
||||
20
|
||||
24
|
||||
0
|
||||
SELECT \n min(number % 2) AS a,\n max(number % 3) AS b\nFROM numbers(10000000)\nGROUP BY \n number % 2,\n number % 3\nORDER BY \n a ASC,\n b ASC
|
||||
SELECT \n any(number % 2) AS a,\n anyLast(number % 3) AS b\nFROM numbers(10000000)\nGROUP BY \n number % 2,\n number % 3\nORDER BY \n a ASC,\n b ASC
|
||||
SELECT max((number % 5) * (number % 7)) AS a\nFROM numbers(10000000)\nGROUP BY \n number % 7,\n number % 5\nORDER BY a ASC
|
||||
SELECT foo\nFROM \n(\n SELECT anyLast(number) AS foo\n FROM numbers(1)\n GROUP BY number\n)
|
||||
SELECT
|
||||
min(number % 2) AS a,
|
||||
max(number % 3) AS b
|
||||
FROM numbers(10000000)
|
||||
GROUP BY
|
||||
number % 2,
|
||||
number % 3
|
||||
ORDER BY
|
||||
a ASC,
|
||||
b ASC
|
||||
SELECT
|
||||
any(number % 2) AS a,
|
||||
anyLast(number % 3) AS b
|
||||
FROM numbers(10000000)
|
||||
GROUP BY
|
||||
number % 2,
|
||||
number % 3
|
||||
ORDER BY
|
||||
a ASC,
|
||||
b ASC
|
||||
SELECT max((number % 5) * (number % 7)) AS a
|
||||
FROM numbers(10000000)
|
||||
GROUP BY
|
||||
number % 7,
|
||||
number % 5
|
||||
ORDER BY a ASC
|
||||
SELECT foo
|
||||
FROM
|
||||
(
|
||||
SELECT anyLast(number) AS foo
|
||||
FROM numbers(1)
|
||||
GROUP BY number
|
||||
)
|
||||
|
@ -1,2 +1,3 @@
|
||||
9
|
||||
SELECT any(number) + (any(number) * 2)\nFROM numbers(3, 10)
|
||||
SELECT any(number) + (any(number) * 2)
|
||||
FROM numbers(3, 10)
|
||||
|
Loading…
Reference in New Issue
Block a user