There is a down-to-date version of a query attempting to use:
< WHEE option_ id from the code> response to WHOE option_ id = 1 and poll_id = 1 and pref = 1) / (pref_percent from SELECT COUNT (*) responses as WHOE poll_id = 1 and pref = 1), (SELECT COUNT (*) responses = 1 and poll_id = 1) / (from replies to COUNT) * (WHEE poll_id = 1) as all_part, deviation through ABS (all_percent-pref_percent) responses by deviation as per order by the user DESCI get this error: Unknown column 'all_percent' in 'Field List'
Apparently, I have a user-defined column ( "All_percent") when creating another user defined column ("deviation").
So, my question is ... how can I modify this query to prevent this error?
i Instead of doing that task in PHP, it is actually to find sorted query results by deviation. Wrap an external query around your current question:
select user_id, pref_percent, all_percent, ABS Deviation (all_percent - pref_percent) as deviation (SELECT user_id, (WHEE option_ id = 1 and poll_id = 1 and pref = 1 from select COUNT (*) responses) / (SELECT COUNT (*) from responses WHERE poll_id = 1 and pref = 1) In the form of pref_percent, (WHERE option_ID = 1 and poll_id = 1) with select COUNT (*) responses) / (responses from replies) * (WHEE poll_id = 1) response to all user_id by the response of the group) Order by ORDER DESC
Comments
Post a Comment