dimanche 17 mai 2020

retrieve random id_post sql

I have the next table

 id_post | post


 24         A
 26         B
 39         C
 57         D

I want to retrieve the a random id_post

 SELECT id_post
 FROM  posts
 WHERE rand()

I would like to retrieve a single value 24, 26, 39 or 57 how can I make that work?




Aucun commentaire:

Enregistrer un commentaire