count number of columns

  • NAMETYPE

    P_iieP

    F_sevF

    P_iieP

    F_sevF

    P_admP

    P_iieP

    In this table P_iie is there for 3 times

    F_Sev = 2 times

    P_adm =1 time

    I need to write a query which can print number of times in another column.

    Result

    NAMETYPEPrefix

    P_iieP3

    F_sevF2

    P_iieP3

    F_sevF2

    P_admP1

    P_iieP3

    OR

    NAMETYPEPrefix

    P_iieP3

    F_sevF2

    P_admP1

  • Are you familiar with "Group By" and "Count"?

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • Lookup GROUP BY and COUNT in Books Online.

    Jeffrey Williams
    “We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”

    ― Charles R. Swindoll

    How to post questions to get better answers faster
    Managing Transaction Logs

  • Thanks i got it...

  • Thanks i got it...

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply