Search
 
SCRIPT & CODE EXAMPLE
 

SQL

mysql random

SELECT name
  FROM random AS r1 JOIN
       (SELECT CEIL(RAND() *
                     (SELECT MAX(id)
                        FROM random)) AS id)
        AS r2
 WHERE r1.id >= r2.id
 ORDER BY r1.id ASC
 LIMIT 1
Comment

mysql rand int

SELECT (FLOOR( 1 + RAND( ) *60 ))
Comment

rand mysql

1
2
3
4
5
SELECT f.id FROM files f
      JOIN ( SELECT RAND() * (SELECT MAX(id) FROM files) AS max_id ) AS m
      WHERE f.id >= m.max_id
      ORDER BY f.id ASC
      LIMIT 1;
Comment

PREVIOUS NEXT
Code Example
Sql :: create table postgresql 
Sql :: postgres find missing indexes 
Sql :: show tablespace oracle 
Sql :: case insensitive sql 
Sql :: how to use timestampdiff in a table in sql 
Sql :: PostgreSQL: To_Number function 
Sql :: import csv to postgresql 
Sql :: sql roll up rows into columns 
Sql :: on sql table data exists 
Sql :: top 3 salary in sql 
Sql :: choose only one for each distinct collumn regardless of other columns 
Sql :: mysql select case insensitive 
Sql :: psql show db 
Sql :: oracle undo tablespace schema 
Sql :: sql group by 
Sql :: order by sql query 
Sql :: copy from one table to another postgres using matching column 
Sql :: date less than in sql 
Sql :: group_concat mysql 
Sql :: sql if else 
Sql :: postgres stored procedure 
Sql :: how to get information about data types in postgreSQL 
Sql :: TRIGGER AFTER 
Sql :: sql not equal to operator 
Sql :: c# sql conennection string 
Sql :: sql server obtener nombre sin espacios en blanco 
Sql :: sql field equals multiple values 
Sql :: check if user defined table type exists in sql server 
Sql :: how to verify sequence result in oracle SQL 
Sql :: sql server get date of previous sunday 
ADD CONTENT
Topic
Content
Source link
Name
7+3 =