[SQL HELP] please read this one....

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [SQL HELP] please read this one....

    i have an SQL query line that is

    Code:
    $nopm = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM table_inbox WHERE senderid='".$senderid."' AND flag='0'"));
    but i want to count that by using GROUP BY ...

    can i count that by using "group by"
    Sandeep DiL (INDIAN)




    #2
    Originally posted by DiL View Post
    i have an SQL query line that is

    Code:
    $nopm = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM table_inbox WHERE senderid='".$senderid."' AND flag='0'"));
    but i want to count that by using GROUP BY ...

    can i count that by using "group by"

    $nopm = mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT user) FROM table_inbox WHERE senderid='".$senderid."' AND flag='0'"));

    replace user with your group by.

    example Group by lala

    Then, DISTINCT lala

    Good luck.
    sigpic
    Visit my WEBSITE Project: http://www.aspirewap.net

    Comment


      #3
      hey thanks buddy... its working for me... you solved my problem...

      but can i ask one more question ??

      whats the meaning of DISTINCT ??

      and its full name ?...
      i want to get some knowledge about that... thanks in advance
      Sandeep DiL (INDIAN)



      Comment


        #4
        Originally posted by DiL View Post
        hey thanks buddy... its working for me... you solved my problem...

        but can i ask one more question ??

        whats the meaning of DISTINCT ??

        and its full name ?...
        i want to get some knowledge about that... thanks in advance
        Only count different value from sql.
        sigpic
        Visit my WEBSITE Project: http://www.aspirewap.net

        Comment

        Working...
        X