tags:

views:

182

answers:

2
+4  A: 

I sometimes use SQLInform to format large SQL scripts, but that may not be what you are after.

Galwegian
nice tool thanks !
ArneRie
+1  A: 

Well, I'd write and indent it all somewhat differently, but whether it's "smarter" is up to you:

$sql = sprintf("
    SELECT %s, %s, %s
    FROM %s
    LEFT OUTER JOIN OS USING (OS_ID)
    JOIN OSSUBVERSION USING (OSSUBVERSION_ID)
    JOIN OSMINORVERSION USING (OSMINORVERSION_ID)
    JOIN OSMAJORVERSION USING (OSMAJORVERSION_ID)
    LEFT OUTER JOIN PROCESSORMODEL USING (PROCESSORMODEL_ID)
    JOIN PROCESSORMANUFACTURER USING (PROCESSORMANUFACTURER_ID)
    WHERE %s = :id
    AND MANDATOR_ID = :mandatorId
", $serverFields, $osFields, $processorFields, $this->_tableName, $this->_identifier);
chaos