I am looking for a c++ library that provides similar functionality to the c# SelectQueryBuilder library
http://www.codeproject.com/Articles/13419/SelectQueryBuilder-Building-complex-and-flexible-S
i.e. it allows one to get away from building horrible concatenated strings into order to form a dynamic SQL query, instead having a library that provides an interface where by you pass it the table, the elements you want to select from the table, etc, and it returns the SQL query as a string.
Any help much appreciated
Edit: Sample Query I am building....and we wont know the actual columns for selection until runtime e.g. don't know how many VAR1...VARx there will be and what exactly they will be.
SELECT * FROM
(
SELECT
table_1.id,
table_2.name,
(select(COALESCE(sum(table_1.col_1 * 1.0) / NULLIF(sum(table_1.col_2 - table_1.col_3),0) * 100,0))) as VAR1,
(select(COALESCE(sum(table_1.col_4 * 1.0) / NULLIF(sum(table_1.col_5),0) * 100,0))) as VAR2,
sum(table_1.col_2) as VAR3
FROM table_1, table_2
WHERE table_1.id = table_2.id
GROUP BY table_1.id, table_2.name
) VARIABLES
WHERE VAR3 > 1000