Make split by gender faster
This commit is contained in:
parent
00d4a7c550
commit
019f3a19c0
@ -209,11 +209,12 @@ class Handler
|
||||
feminidad = 0
|
||||
sql = %(
|
||||
SELECT COALESCE((SELECT frecuencia FROM mujeres WHERE nombre='#{row[1]?.to_s.upcase}'), 0) AS mujeres,
|
||||
COALESCE((SELECT frecuencia FROM hombres WHERE nombre='#{row[1]?.to_s.upcase}'), 0) AS hombres
|
||||
COALESCE((SELECT frecuencia FROM hombres WHERE nombre='#{row[1]?.to_s.upcase}'), 0) AS hombres
|
||||
)
|
||||
cursor.query sql do |result|
|
||||
mujeres = result.read(Int32)
|
||||
hombres = result.read(Int32)
|
||||
puts "frecuencias: #{mujeres} #{hombres}"
|
||||
if hombres == mujeres == 0
|
||||
feminidad = 0.5
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user