diff --git a/include/sqlpp11/table_alias.h b/include/sqlpp11/table_alias.h index 4985a875..c94557f9 100644 --- a/include/sqlpp11/table_alias.h +++ b/include/sqlpp11/table_alias.h @@ -74,9 +74,12 @@ namespace sqlpp static Context& _(const T& t, Context& context) { - context << "("; + if (requires_braces_t::value) + context << "("; serialize(t._table, context); - context << ") AS " << name_of::char_ptr(); + if (requires_braces_t::value) + context << ")"; + context << " AS " << name_of::char_ptr(); return context; } };