Select in a view for more result

  • hy !

    There is my view

    mvtDtate mvtMouvementDebCred TypemvtMouvementDebCred

    1/1/2013 154 000 D

    2/1/2013 210 000 C

    3/1/2013 654 012 D

    4/1/2013 213 000 564 C

    After more essay : And I want a result as this : the mvtMDebCred type D in a Columm and the same for the type C

    mvtDtate mvtMDebCred mvtMDeb mvtMCred TypemvtMDebCred

    1/1/2013 154 000 154 000 ----------- D

    2/1/2013 210 000 ----------- 210 000 C

    3/1/2013 654 012 654 012 ---------- D

    4/1/2013 213 000 ----------- 213 000 564 C

    thanks ........

  • mhmdsow (3/23/2013)


    hy !

    There is my view

    mvtDtate mvtMouvementDebCred TypemvtMouvementDebCred

    1/1/2013 154 000 D

    2/1/2013 210 000 C

    3/1/2013 654 012 D

    4/1/2013 213 000 564 C

    After more essay : And I want a result as this : the mvtMDebCred type D in a Columm and the same for the type C

    mvtDtate mvtMDebCred mvtMDeb mvtMCred TypemvtMDebCred

    1/1/2013 154 000 154 000 ----------- D

    2/1/2013 210 000 ----------- 210 000 C

    3/1/2013 654 012 654 012 ---------- D

    4/1/2013 213 000 ----------- 213 000 564 C

    thanks ........

    What you have posted is difficult to read and does not make it easy for people to help you by allowing them to run tests against your data on their own instance SQL Server. For better, faster answers please provide:

    1. DDL in the form of CREATE TABLE statements to create your sample tables

    2. DML in the form of INSERT INTO statements to populate the sample tables

    3. Your expected result based on your sample data

    4. Most importantly: what you have tried so far

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • hy , thanks members

    my problems is resolved ...

    there is my query :

    SELECTmvtDtate

    ,mvtMDebCred

    ,CASE WHEN TypemvtMDebCred = 'D' THEN mvtMDebCred END AS mvtMDeb

    ,CASE WHEN TypemvtMDebCred = 'C' THEN mvtMDebCred END AS mvtMCred

    ,TypemvtMDebCred

    FROM...

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

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