Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT PimItemTable.id, PimItemTable.remoteId, MimeTypeTable.name, ResourceTable.name, SUM( PartTable.name = 'PLD:HEAD' AND PartTable.datasize > 0 ) as hasPart0
- FROM PimItemTable
- INNER JOIN MimeTypeTable ON ( PimItemTable.mimeTypeId = MimeTypeTable.id )
- INNER JOIN CollectionTable ON ( PimItemTable.collectionId = CollectionTable.id )
- INNER JOIN ResourceTable ON ( CollectionTable.resourceId = ResourceTable.id )
- LEFT JOIN PartTable ON ( PimItemTable.id = PartTable.pimItemId AND substr(PartTable.name, 1, 4 ) = ( :0 ) )
- WHERE ( ( PimItemTable.id >= :1 ) AND collectionId = :2 AND ResourceTable.name <> ( :3 ) )
- GROUP BY PimItemTable.id
- HAVING ( hasPart0 < :4 OR hasPart0 IS NULL )
- ORDER BY PimItemTable.id ASC
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement