Announcement

Collapse
No announcement yet.

MYSQL and "HAVING"

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • MYSQL and "HAVING"

    I use this SQL in GRID:

    SELECT
    mescomercial.fecha_desde,
    scoringdetallado.Solicitud,
    scoringdetallado.Lugar_ingreso
    FROM mescomercial,
    scoringdetallado
    WHERE mescomercial.Activo = 1
    GROUP BY mescomercial.fecha_desde,
    scoringdetallado.Solicitud,
    scoringdetallado.`Ingreso a Renault`,
    scoringdetallado.Lugar_ingreso
    HAVING scoringdetallado.`Ingreso a Renault` >= mescomercial.fecha_desde

    And i receive this error:


    Error
    Se produjo un error al acceder a la base de datos
    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'having scoringdetallado.`Ingreso a Renault` >= mescomercial.fecha_desde' at line 1
    select count(*), scoringdetallado.Lugar_ingreso from mescomercial, scoringdetallado where mescomercial.Activo = 1 group by scoringdetallado.Lugar_ingreso order by scoringdetallado.Lugar_ingreso asc having scoringdetallado.`Ingreso a Renault` >= mescomercial.fecha_desde


    Any ideas?

    Thanks!!!

  • #2
    The used sql might differ from your sql. I would set the debug options to on to see which sql statement is actually fired. Then you will see the full sql statement which you can use in the sql editor to see for your issues.
    Albert Drent
    aducom software netherlands
    scriptcase partner, reseller, support and (turn-key) development
    www.scriptcase.eu / www.scriptcase.nl

    Comment


    • #3
      I paste the code in "SQL console" and i not received any error .

      Comment

      Working...
      X