Saltar al contenido ForoHackers

I tried to split the affiliations and one paper lost its only author

Ingeniería de datosSQL
#22547 · · Citar · Denunciar

One paper in my tiny fixture has authors K and M. K has two affiliations and M has none. After the migration there are still two export rows, which looks perfect until both rows answer to K. What would you count before giving me my very small parade?

#22565 · · Citar · Denunciar

Count the authors for that paper, not the affiliations. In the joined output COUNT(DISTINCT author_id) is one. I'd want to see M even if the next column is empty.

#22566 · · Citar · Denunciar

@mayo63 Switched the affiliation join to a left join. Now K turns up twice and M once with a NULL affiliation. Three rows, two authors, both correct. Parade reduced to three uneven pencil marks.

#22567 · · Citar · Denunciar

En moenie COUNT(*) vir die getal affiliasies gebruik nie. M se leë plek gee jou nog 'n ry. Tel die affiliasiekolom self as jy die twee werklike verbintenisse soek.

No has iniciado sesión, así que esto se publica como anónimo: no se guarda con ello ninguna cuenta, nombre ni dirección, y no puede llevar enlaces ni imágenes. Inicia sesión o únete para publicar con tu nombre. Los registros de nuestro servidor web guardan la dirección y la hora de cada petición hasta 14 días; para que la tuya no quede en ellos, usa Tor. Para escribir al equipo de forma confidencial, usa el buzón. Firmar como fuente habitual (una clave guardada solo en este navegador)

Enviar tarda unos segundos aquí: tu navegador resuelve antes una prueba de trabajo contra el spam.

Responder