mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
SchemaAlias improvement
git-svn-id: svn://ultimatepp.org/upp/trunk@1852 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
de2d1b68d4
commit
e527abb455
1 changed files with 5 additions and 2 deletions
|
|
@ -569,12 +569,15 @@ SqlVal Alias(const SqlVal& value, const SqlVal& alias)
|
|||
|
||||
SqlVal SchemaAlias(const SqlVal& table, const SqlVal& alias)
|
||||
{
|
||||
return SqlCol(~SchemaTable(table) + SqlCase(MSSQL, " as ")(" ") + ~alias);
|
||||
SqlVal st = SchemaTable(table);
|
||||
if(~st == ~alias)
|
||||
return st;
|
||||
return Alias(st, alias);
|
||||
}
|
||||
|
||||
SqlVal SchemaAlias(const SqlVal& table)
|
||||
{
|
||||
return SqlCol(~SchemaTable(table) + SqlCase(MSSQL, " as ")(" ") + ~table);
|
||||
return SchemaAlias(table, table);
|
||||
}
|
||||
|
||||
SqlId SchemaId(SqlId table_id)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue