#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    2
    Rep Power
    0

    How can I Select FROM all_objects in MySQL?


    Hi people,
    I am using mySQL 5.5.25
    how can I do this in MySQL?

    SELECT
    to_char(to_date('00:00','HH24.MI')+(rownum-1)/24,'HH24:MI')||'-'||
    to_char(to_date('00:00','HH24.MI')+(rownum-1)/24+59/1440,'HH24:MI') timeperiod
    FROM all_objects
    WHERE ROWNUM <= 24


    Thanks in Advance,
    KACHEN T.
  2. #2
  3. SQL Consultant
    Devshed Supreme Being (6500+ posts)

    Join Date
    Feb 2003
    Location
    Toronto Canada
    Posts
    27,235
    Rep Power
    4279
    i would start by creating a numbers table
    Code:
    CREATE TABLE numbers ( n INTEGER NOT NULL PRIMARY KEY );
    INSERT INTO numbers ( n ) VALUES 
     (0),(1),(2),(3),(4),(5),(6),(7),(8),(9)...
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

IMN logo majestic logo threadwatch logo seochat tools logo