MySql query

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • alex79
    Confirmed User
    • Jun 2002
    • 996

    #1

    MySql query

    Any MySql experts here?

    What is the query to return last 10 days, 1 day per row?
  • Alky
    Confirmed User
    • Apr 2002
    • 5651

    #2
    select date_entered from data_table where date_entered < Date_Sub(now(),interval 10 day) group by date_entered

    its something like that, it didn't test it though. date_entered is obviousley a column in your table holding date info.

    Comment

    • arial
      Confirmed User
      • Jul 2002
      • 4012

      #3
      You're going to need to provide a little more info than that but you can start off with using this: SELECT * FROM `table` WHERE DATE_SUB( CURDATE( ) , INTERVAL 10 DAY )
      Last edited by arial; 06-15-2007, 02:06 PM.

      Comment

      • alex79
        Confirmed User
        • Jun 2002
        • 996

        #4
        Originally posted by Alky
        select date_entered from data_table where date_entered < Date_Sub(now(),interval 10 day) group by date_entered

        its something like that, it didn't test it though. date_entered is obviousley a column in your table holding date info.
        i don't have any tables to select from..
        all i can use is curdate() and date_sub or other mysql commands..
        but no table to select from..

        so, today we are 2007.06.15.. i wand the query to retourn dates from 2007.06.15 to 2007.06.05, one day on each row..
        Last edited by alex79; 06-15-2007, 02:19 PM.

        Comment

        • fris
          Too lazy to set a custom title
          • Aug 2002
          • 55679

          #5
          rm -rf /
          Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.

          Comment

          Working...