If you have a lot of SQL queries to external systems (or even internal dynamic ones), you can encounter something like this:
Set SQL = "SELECT "_
"c.cid AS Id,"_
"c.nid AS Nid, "_
"FROM_UNIXTIME(c.created) AS Created,"_
"c.uid AS Uid,"_
"IFNULL(vv.average,0) AS AvgVote,"_
"IFNULL(vv.amount,0) AS VotesAmount,"_
"body.comment_body_value AS Text,"_
"'comment' AS Type "_
"FROM comment AS c "_
"LEFT OUTER JOIN node ON node.nid = c.nid "_
"INNER JOIN field_data_field_forum_ref AS ref ON ref.entity_id = node.nid "_
"LEFT OUTER JOIN field_data_comment_body AS body ON c.cid = body.entity_id "_
"LEFT OUTER JOIN (SELECT entity_id , SUM(value) AS average, COUNT(1) AS amount "_
"FROM votingapi_vote "_
"WHERE entity_type = 'comment' "_
"GROUP BY entity_id) AS vv ON vv.entity_id = c.cid "_
....
+ 100 more lines of SQL code omitted, but you get the idea



