Results 1 to 4 of 4

Thread: please tell me

  1. #1
    Join Date
    Jun 2010
    Posts
    3

    Unanswered: please tell me

    please tell me how to i make a sql query for
    selecting data's from a table where that data repeated 4 times in that column

  2. #2
    Join Date
    Dec 2007
    Location
    Richmond, VA
    Posts
    1,328
    Provided Answers: 5
    how about a bit more info? Your question is rather vague. Try showing what data you have and what you would like to see as output.
    Dave

  3. #3
    Join Date
    Jun 2010
    Posts
    3
    i have a table named department and the columns are dep_id dep_name ...etc

    i want to select datas from field(coulmn) where which is repeated 4 times or more


    for eg: if department ids (dep_id) are mech,computer,civil

    and if in column dep_id mech data repeated 6 times
    and in column dep_id data computer repeated 2 times
    and in column dep_id data civil repeated 3 times


    i want a sql query to select data mech from the column dep_id (bcz the data mech repeated 6 times ie more than 4)

  4. #4
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Code:
    SELECT dep_id
       FROM t
       GROUP BY dep_id
       HAVING 4 <= Count(*);
    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

Posting Permissions

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