SQL is neither the fastest nor the most elegant way to talk to databases, but it is the best way we have. Here’s why Today, Structured Query Language is the standard means of manipulating and querying ...
More like a.code + '%'. Just the right side, not both. Your original example was flawed in any event, as you'd have been looking for the literal word a.cidcode, not what was in the variable.