0

Hi could anyone help me with something?

I need a mysql query that can return 4 values from a column in some table, also select all fiels from each row.

something like:

SELECT * FROM dadoslivros WHERE RAND() =1 limit 100;

But i only want the random form row ID.

Thanks.

1
  • 1
    How about ordering your results randomly? SELECT * FROM dadoslivros ORDER BY RAND() LIMIT 4 Commented Feb 14, 2013 at 22:43

1 Answer 1

1

It seems like you just want to use ORDER BY RAND():

select *
from dadoslivros
order by rand()
limit 100

See SQL Fiddle with Demo

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.