two select in a request

  • Mickaël Foucaux

    I try to do that sql request :

    SELECT @sum_mouth := sum(mouth) FROM project_history
    WHERE id_project = 1;

    SELECT sum (mouth / @sum_mouth) * pourcent_working
    FROM project_history
    WHERE id_project = 1;

    ... but the point comma not accept by MySQLCommand. (In fact it's throw an error : wrong query)

    I must make it in two times into C#. I do not find that very very well.

    How do it on once time ?

    • Ellery Familia

      Ellery Familia - 2004-01-29

      i think this is a bug... i try doing the same thing and I had to do two executions for two queries. Play with it a little more, then post it as a bug.

    • bjvandi pohvak

      bjvandi pohvak - 2009-02-14

      i tried to insert multiple lines at one connection (insert into tbTest (id,name) values (1,'david'); insert into tbTest (id,name) values (2,'nobody');) but i got the wrong query exception, can anyone solve this? thank you


Log in to post a comment.