This very well may not be possible.
I am performing a SOQL with a user's Id to get their name and I would like for this to be a one liner pretty much.
What I'm wondering if there is a way to do is the following
String userName = [SELECT Id, Name FROM User WHERE Id = :userId LIMIT 1][0].Name;
I would like to access the SOQL array directly and get the occurence. Is something like this possible?