Skip to content Skip to sidebar Skip to footer

Values Not Being Defined When Outputted In Python MySQL?

Aided by a previously asked question see (How to correctly convert SQL rows to columns?), I'm attempting to apply to a MySQL connector script written in python. As seen by @Popeye

Solution 1:

You have used wrong names.(in case expression names are used without space. You should use it exactly same as per val)

Replace

max(case when name = 'PersonA' then A end) as PersonA

With

max(case when name = 'Person A' then A end) as PersonA

See the space between Person and A in name. Do the same for Person B and Person C


Post a Comment for "Values Not Being Defined When Outputted In Python MySQL?"