Take a look at my library, swigql[1]. You can create a base query and then extend that query however you want via template inheritance.
Prepared statements, by contrast, are also a form of string concatenation. And they have some understanding of type and syntax, but only because they learn them from the server:
http://www.postgresql.org/docs/9.2/static/sql-prepare.html
http://dev.mysql.com/doc/refman/5.0/en/sql-syntax-prepared-s...
Prepared statements are NOT string concatenation. The server parses the SQL, creates what internal representation it does, and then uses the parameters more as arguments to that executable statement than checks them and sticks them in. At no point does a SQL statement exist with the parameters and SQL.