Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2007
    Posts
    16

    Question Unanswered: Count order by a field

    Hi,

    I need to have the count of an item by another item.

    Ex:

    TAB1

    Field1 Field2
    ----- -------
    AAA abc
    AAA def
    BBB abc
    AAA xyz
    BBB lmn
    CCC zzz

    I need to get by a select only the items of the Field1 which have 2 or more Field2

    Like that

    Field2
    ----------
    abc

    thanks for your helps.

  2. #2
    Join Date
    Jul 2006
    Posts
    115
    is it mean u want to count no of field_2 in the table? if yes,

    select Field2 from <table> group by Field2 having count(*) >=2

  3. #3
    Join Date
    Jan 2007
    Posts
    16
    Thks ymho it works !!

Posting Permissions

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