Writing a news ticker module. It works, but it's sloppy as hell. Is there a better way to do this query?
Two things jump out at me, both related to the use of {url_alias}:


I don't see why you need to do the string shenanigans in the WHERE.  You should be able to to use node.type to limit yourself to the subset of nodes you want, especially if you are primarily using Pathauto settings.
I don't see why you explicitly need to return url_alias.dst in the result set. If you have the nid, then you can just use $path = url('node/' . $nid); to build up paths (or use l()).


I think this means that you should be able to eliminate the JOIN on the {url_alias} altogether, which should make the query much faster.