Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2006
    Posts
    4

    Unanswered: can some write a query?

    There is a table with veg_ids (‘vid’) and fru_ids (‘fid’). Each gene only resides on a single clone and each clone may contain multiple genes. How do you find how many genes are on each and every clone?

  2. #2
    Join Date
    May 2005
    Location
    South Africa
    Posts
    1,365
    Provided Answers: 1
    Seeking a developer? Maybe you should also tell how much the job pays.

    Else
    post what you have attempted already
    select cid,count(*) as 'count'
    from #mytable group by cid

    post the DDL of your table
    Like

    create table #mytable (gid int, cid int)
    create unique index ix1 on #mytable(gid)

    some sample data,
    Like

    insert into #mytable select
    1,1 union all select
    2,3 union all select
    3,1 union all select
    4,1 union all select
    5,2 union all select
    6,3

    And the expected results
    Code:
    cid         count       
    ----------- ----------- 
              1           3 
              2           1 
              3           2

Posting Permissions

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