Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2012
    Posts
    1

    Unanswered: Need help, with some simple SQL

    This is just some very simple SQL code, if anyone could point out to me why it's not working, it'd be much appreciated:

    "USE Fruit_list
    SELECT
    a.oranges,
    a.pears,
    fruitcount = count(*),
    apples,
    b.banana,
    a.day
    FROM Fruits a
    JOIN Fruits b
    ON a.banana = b.banana
    WHERE day between ('20090508') and ('20110508')
    AND ActiveFlg = 1
    GROUP BY
    a.oranges,
    a.pears,
    apples,
    b.banana,
    a.day"

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    first of all, you should probably have posted this in the microsoft sql server form, because fruitcount = count(*) is not valid ANSI sql

    more importantly, you neglected to mention what "not working" means
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •