Results 1 to 6 of 6

Thread: Sql Query

  1. #1
    Join Date
    Sep 2006
    Posts
    6

    Unhappy Sql Query


    There is a table which is not having any Constraints.
    I want to display a column with some values (not all).
    In that column I want to display only some values which are occurring more then one time.
    Ex
    Let us consider emp table in emp table emp no 7433 is occurring more then one time then I want to display only 7433.
    Please help me
    Thanks&Regards
    Sarma

  2. #2
    Join Date
    Sep 2006
    Posts
    6
    i got the query

    select emp_no,count(emp_no) from emp
    group by emp_no
    having count(emp_no) > 1

  3. #3
    Join Date
    Sep 2006
    Posts
    6

    Red face Qurey Answer

    select emp_no,count(emp_no) from emp
    group by emp_no
    having count(emp_no) > 1
    Regards
    Sarma

  4. #4
    Join Date
    Sep 2006
    Posts
    9

    Answer for Query

    select count(emp_no) "Emp_NO" from emp
    group by emp_no
    having count(emp_no) > 1

    does that solve your problem???
    Last edited by zahid_ali; 10-11-2006 at 04:59 PM. Reason: My mistake...u wanted the count right

  5. #5
    Join Date
    Jul 2005
    Posts
    13
    how about

    SELECT DISTICT empno, ....

    Ammar Sajdi
    www.e-ammar.com

  6. #6
    Join Date
    Oct 2006
    Posts
    3
    is there a particular way to save 'text' field types? i get this error: You have an error in your SQL syntax near 'desc = test' at line 1

Posting Permissions

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