Changes

Multi-select CDFs

345 bytes added, 21:47, 10 September 2015
no edit summary
{{Warning | This page contains UPDATE syntax }}
[[Image:CDF used twice.png|250px|center]]If the result set contains '''other ''' values than NULL and 0, you need to carefully analyse why because that is an indication that it could be templates where the same CDF has been entered more than once.
<pre>
SELECT
cdfvalue.`position`
</pre>
 
[[Image:CDF used twice2.png|500px|center]]
This query will show if the same CDF is used more than once.
<pre>
SELECT
cdfvalue.position,
cdfvalue.cdf_id,
Count(cdfvalue.cdfvalue_guid)
FROM
cdfvalue
GROUP BY
cdfvalue.`position`,
cdfvalue.cdf_id
order by
cdfvalue.cdf_id,
cdfvalue.`position`
</pre>
 
This query can be run in mySQL (5.08.04) or in Postgres (6.0). It is recommended to run it on 5.08.04 as part of the pre-checks and updates.
<pre>
UPDATE cdfvalue
where position is NULL
</pre>
 
This query can be run in mySQL (5.08.04) or in Postgres (6.0). It is recommended to run it on 5.08.04 as part of the pre-checks and updates.
 
{{NavBox Upgrade}}
[[Category:NoPublic]]
[[Category:SQL Queries]]
6,632
edits