Hai,
I have a table like,
+-------+----------+-----------+-------------+----------+---------+--- +------+-----------+--------+----------+ | PdbId | MetalAtm | MetalName | MetalNumber | MetalChn | AtmName | Re +sName | ResNumber | ResChn | Distance | +-------+----------+-----------+-------------+----------+---------+--- +------+-----------+--------+----------+ | 1nc7 | MG | MG | 1501 | - | CL | CL | 1401 | - | 3.065 | | 1nc7 | MG | MG | 1501 | - | CL | CL | 1402 | - | 2.660 | | 1pex | CA | CA | 503 | - | CL | CL | 501 | - | 2.895 | | 1qhu | NA | NA | 3 | - | CL | CL | 1 | - | 3.096 | | 1qjs | NA | NA | 513 | A | CL | CL | 511 | A | 3.096 | | 1rtg | CA | CA | 2 | - | CL | CL | 1 | - | 3.079 | | 1xj6 | NA | NA | 5002 | - | CL | CL | 5001 | - | 2.628 | | 2caj | NI | NI | 1151 | B | CL | CL | 1150 | B | 3.551 | | 2oa9 | CD | CD | 911 | - | CL | CL | 800 | - | 2.291 | | 2oa9 | CD | CD | 913 | - | CL | CL | 801 | - | 2.403 | +-------+----------+-----------+-------------+----------+---------+--- +------+-----------+--------+----------+

I want to retrieve the rows only the count must have of single PdbId with RESNAME=CL should >=2 that means i want to retreive only

+-------+----------+-----------+-------------+----------+---------+--- +------+-----------+--------+----------+ | PdbId | MetalAtm | MetalName | MetalNumber | MetalChn | AtmName | Re +sName | ResNumber | ResChn | Distance | +-------+----------+-----------+-------------+----------+---------+--- +------+-----------+--------+----------+ | 1nc7 | MG | MG | 1501 | - | CL | CL | 1401 | - | 3.065 | | 1nc7 | MG | MG | 1501 | - | CL | CL | 1402 | - | 2.660 | | 2oa9 | CD | CD | 911 | - | CL | CL | 800 | - | 2.291 | | 2oa9 | CD | CD | 913 | - | CL | CL | 801 | - | 2.403 | +-------+----------+-----------+-------------+----------+---------+--- +------+-----------+--------+----------+

thanks in advance

In reply to (OT)Count the Column values if it same in the column by editi

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.