Jump to content

sierra_senthil

New Members
  • Posts

    1
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

sierra_senthil's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi All My SQL Ver : 3.23.55-nt I have one table emp with 2 cols (userid,bossid ), can someone help me writing the query to find out one user is boss of how many like in this userid 16 is boss for 2 and userid12 is boss of 3 eg: USERID TOTAL 16 2 13 3 17 0 (Geting this row is imp for me. i mean the ) I should also be able to get total as 0 if the the user is not the boss of anyone..(as per my data) Thanks In Advance.. Sierra ************************************** create table emp (userid int,bossid int) insert emp values(12,0) insert emp values(13,12) insert emp values(16,12) insert emp values(17,12) insert emp values(18,13) insert emp values(19,13) insert emp values(20,13) insert emp values(23,16) insert emp values(24,23) insert emp values(26,23) insert emp values(27,23) insert emp values(28,16) insert emp values(29,26) insert emp values(30,26) insert emp values(31,30) insert emp values(32,31)
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.