How To make code for these Table?

  • Hi Friends,

    create table turn

    (

    cust_det varchar(20),

    product varchar(20),

    combo varchar(20),

    Bill_no int,

    stock int,

    bill_date datetime

    )

    insert into turn(cust_det,product,combo, Bill_no,stock,bill_date) values('ram','Milk','-','25','15','01-apr-2013')

    insert into turn(cust_det,product,combo,stock,bill_date) values('ram','MIlk + Biscuit','25','22','01-apr-2013')

    insert into turn(cust_det,product,combo,stock,bill_date) values('sam','MIlk + Biscuit','26','22','01-apr-2013')

    i need the result like cust,prodcut,sales =(without combo),FREE=(combo-stock)

    how to make a code for these?

  • I'm not sure what you really want for you result set. Can you give us the actual results you want with real values and numbers?



    Microsoft Certified Master - SQL Server 2008
    Follow me on twitter: @keith_tate

    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • What do you have so far? It may be easier to see what you are developing and to see your issue.

    Kurt

    Kurt W. Zimmerman
    SR DBA
    Lefrak Organization
    New York, NY

    http://www.linkedin.com/in/kurtwzimmerman

Viewing 3 posts - 1 through 2 (of 2 total)

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