You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var userId = 1;
var columns = ['username AS 用户名', 'email AS 邮箱'];
var sql = SqlString.format('SELECT ?? FROM ?? WHERE id = ?', [columns, 'users', userId]);
How to make this work correctly?
The text was updated successfully, but these errors were encountered:
You would use the toSqlString functionality to create column objects. There are many ways to do this, but here is one:
functionColumn(name,alias){returnSqlString.raw(SqlString.format('?? AS ??',[name,(alias||name)]))}varuserId=1;varcolumns=[Column('username','用户名'),Column('email','邮箱')];varsql=SqlString.format('SELECT ? FROM ?? WHERE id = ?',[columns,'users',userId]);
for example
How to make this work correctly?
The text was updated successfully, but these errors were encountered: