SQL Server: Proper way to order by name -
i have query containing lines following:
select b.lastname + ', ' + b.firstname tm
currently use order tm
in order sort, seems work.
however, in order right, can tell me correct way here order tm
?
order tm, order b.tm, order b.lastname + ', ' + b.firstname
or else?
also, can tell me if need put tm
in single quotes?
it seems work without quotes want make sure right.
order tm
best way!
order b.tm,
no, tm not 1 of b's columns.
order b.lastname + ', ' + b.firstname
can done, first alternative easier.
qutes required reserved words, , identifiers including strange characters (incl space).
Comments
Post a Comment