On 9 Nov 2012, at 4:16pm, Clemens Ladisch <[email protected]> wrote:
> Just use SQL to generate the SQL query: > > SELECT 'SELECT units.id AS "unit id"' AS SQL > UNION ALL > SELECT ', cv' || id || '.value AS ' || quote(name) FROM configtypes > UNION ALL > SELECT 'FROM units JOIN unit_types ON units.unit_type_id = unit_types.id' > UNION ALL > SELECT 'LEFT JOIN (unittype_config JOIN configvalues' || > ' ON unittype_config.configvalue_id = configvalues.id' || > ' AND unittype_config.configtype_id = ' || id || ') AS cv' || id || > ' ON unit_types.id = cv' || id || '.unit_id' FROM configtypes I'm sending you my psychiatrist's bill. In answer to the original query, my instinct is to say that you should be using your own software to collect the results of several SELECTs, not trying to do everything inside a database engine. Simon. _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

