Normally you create a custom macro and use kentico API to do that, but sometimes you can get by with already defined objects {% GlobalObjects.Users.Where("UserName='Administrator'").FirstItem["UserName"] |(identity)GlobalAdministrator%}
P.S. Queries objects shows the content of CMS_Query table, you can't really run this as SQL query.