DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: Help in Query

  1. #1
    Join Date
    Feb 2010
    Posts
    6

    Help in Query

    The below is the data in a table:
    Code:
    Name	Cost	SoldAmt	SoldBill
    A1	5	8		22
    B2	1		
    A1	8	15		21
    C3	5	10		20
    A1	7	8		R2
    A1	8		
    A1	5	3		D2
    B2	3	2		18
    B2	3		
    C3	1
    For all the Items whose SoldBill start with either 'D' or 'R', I need the count

    I need the Ouput as below:
    Code:
    Name	Count of Retun
    A1	2
    B2	0
    C3	0
    I wrote a query which gives output as
    Code:
    Name	Count of Retun
    A1	2
    Its not giving the Ouput for rows whose count is zero.

  2. #2
    Join Date
    Mar 2007
    Location
    Ft. Lauderdale, FL
    Posts
    3,555
    Business specs match the results of your -unpublished- query.
    Business specs are adamant about the rows that have to be considered - based on value of SoldBill column.
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.

Posting Permissions

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


Click Here to Expand Forum to Full Width