how to Mutiply different data type columns

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sqldba
    New Member
    • Dec 2007
    • 8

    how to Mutiply different data type columns

    Hi ,

    I have the below tables

    Table 1 with columns

    id int
    price char
    quantity int
    date date

    In this table, same id has several entries at different date.

    table 2 with columns

    groupid int
    groupname char


    table 3 with columns

    id int
    groupid int


    I want the result as

    id
    groupname
    sum(quantity * price) for each id

    Please help me in writing a query for this

    Thanks in advance
  • amitpatel66
    Recognized Expert Top Contributor
    • Mar 2007
    • 2358

    #2
    Originally posted by sqldba
    Hi ,

    I have the below tables

    Table 1 with columns

    id int
    price char
    quantity int
    date date

    In this table, same id has several entries at different date.

    table 2 with columns

    groupid int
    groupname char


    table 3 with columns

    id int
    groupid int


    I want the result as

    id
    groupname
    sum(quantity * price) for each id

    Please help me in writing a query for this

    Thanks in advance
    Go ahead. Price will be internally converted to Integer and will get multiplied with Qty.

    Comment

    Working...