SQL Converter
This tool will accept a SQL statement and it will convert that statement as best as it can into the Flexviews SQL API.
The basic idea is to show you how to construct a view using the API so that you can do it yourself and not rely on the tool.
# WARNING: You did not specify a database schema for (t1) in the FROM clause.
# The database select above will be used for this table.
# WARNING: You did not specify a database schema for (t3) in the FROM clause.
# The database select above will be used for this table.
# REFRESH_TYPE: INCREMENTAL
CALL flexviews.create('test', 'test_flexview', 'INCREMENTAL');
SET @mvid := LAST_INSERT_ID();
CALL flexviews.add_table(@mvid,'test', 't1','theone', NULL);
CALL flexviews.add_table(@mvid,'test', 't2','t2', 'using (c3)');
CALL flexviews.add_table(@mvid,'test', 't3','t3', 'on t2.c1 = t3.c1 and t1.c1 = t3.c1');
CALL flexviews.add_expr(@mvid,'GROUP', 'c1', 'b0');
CALL flexviews.add_expr(@mvid,'GROUP', 'c2', 'b1');
CALL flexviews.add_expr(@mvid,'SUM', 'c3*c1', 'b2');
CALL flexviews.add_expr(@mvid,'WHERE','c4 = 10' , 'where_clause');
CALL flexviews.enable(@mvid);