[SQL] Unknown column in where clause

Dieses Thema im Forum "Webentwicklung" wurde erstellt von onip, 26. Februar 2013 .

Schlagworte:
Status des Themas:
Es sind keine weiteren Antworten möglich.
  1. 26. Februar 2013
    Unknown column in where clause

    hi,

    ich hab eine abfragen in etwa so:
    Code:
    SELECT
    ta.id AS id,
    ta.name AS name,
    (SELECT count(*) FROM tb WHERE id=ta.id) AS articleCount
    FROM ta
    WHERE articleCount>0
    
    leider weider kommt dieser fehler:
    Code:
    Unknown column 'articleCount' in 'where clause'
    
    gibt es ne möglichkeit nach articleCount abzufragen?
     
  2. 26. Februar 2013
    AW: Unknown column in where clause

    HAVING
     
    1 Person gefällt das.
  3. 26. Februar 2013
    Zuletzt bearbeitet: 26. Februar 2013
    AW: Unknown column in where clause

    perfekt, danke
    Code:
    SELECT
    ta.id AS id,
    ta.name AS name,
    (SELECT count(*) FROM tb WHERE id=ta.id) AS articleCount
    FROM ta, tb
    GROUP BY ta.id
    HAVING articleCount>0
    
     
  4. Video Script

    Videos zum Themenbereich

    * gefundene Videos auf YouTube, anhand der Überschrift.