List:General Discussion« Previous MessageNext Message »
From:Victoria Reznichenko Date:May 8 2002 11:22am
Subject:Re: SQL Help:MySQL Specific
View as plain text  
Virgosys,
Wednesday, May 08, 2002, 12:06:33 PM, you wrote:

VS> I am facing difficulty in fetching records when encounterd with different
VS> cases.

VS> for example:

VS> I want count of all the records from leads table where status = 0 , status
VS> =1, status = 3....etc. This should happen in a single query, is it possible?

VS> This is possible using DECODE function in Oracle. But in MySql, I could not
VS> find any function that supports DECODE functionality given by oracle.

VS> Could you please help me out.

I don't work with Oracle and don't know how DECODE function works, but
I hope that following statement will help you:
     SELECT status, COUNT(*) FROM your_table GROUP BY status;

You can find some more info about counting rows in MySQL at:
     http://www.mysql.com/doc/C/o/Counting_rows.html

VS> TIA
VS> Rajiv




-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Victoria Reznichenko
 / /|_/ / // /\ \/ /_/ / /__   Victoria.Reznichenko@stripped
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
       <___/   www.mysql.com



Thread
SQL Help:MySQL SpecificVirgosys Software8 May
  • Re: SQL Help:MySQL SpecificVictoria Reznichenko8 May
  • RE: SQL Help:MySQL SpecificJay Blanchard8 May