MySQL Forums
Forum List  »  Spanish

COUNT y SUM con JOIN
Posted by: Ruben Alvarez
Date: November 15, 2018 09:57AM

Buenas Tardes

recurro a uds ya que en versiones anteriores de esta sentencia SQl funcionaba bien en PERL:

$sql_util1 = "SELECT t1.*,
t2.*,
COUNT(t2.dias_utilidad) AS cuenta
FROM nominas t1
LEFT JOIN utilidades t2 ON t2.anoutilidad = $N_ano_nomina
WHERE t1.sts1 = 'ACT' and
t1.idnomina = $N_cualnomina";


Hoy dia no puedo hacer la funcionar si le quito el COUNT en este caso si funciona.

$sql_util1 = "SELECT t1.*,
t2.*
FROM nominas t1
LEFT JOIN utilidades t2 ON t2.anoutilidad = $N_ano_nomina
WHERE t1.sts1 = 'ACT' and
t1.idnomina = $N_cualnomina";

USANDO
- mysql Ver 14.14 Distrib 5.7.24, for Linux (x86_64)
- perl5 (revision 5 version 26 subversion 1)
- Distributor ID: Ubuntu
Description: Ubuntu 18.04.1 LTS
Release: 18.04
Codename: bionic

Options: ReplyQuote


Subject
Views
Written By
Posted
COUNT y SUM con JOIN
1119
November 15, 2018 09:57AM
372
November 15, 2018 06:37PM
409
December 04, 2018 12:40PM
456
December 09, 2018 08:22PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.