« first day (1974 days earlier)      last day (684 days later) » 

4:42 PM
what does where 1 mean? "SELECT * FROM settings WHERE 1;"
nvm
12
Q: What does "WHERE 1" mean in SQL?

Emanuil RusevSometimes phpMyAdmin generates queries like: SELECT * FROM `items` WHERE 1 LIMIT 0 , 30 I wonder if WHERE 1 has any meaning in a query like that.

 
5:34 PM
@kush It means the person who was dynamically building the query was using a very simple method :-)
 
 
5 hours later…
10:30 PM
I have a large table (1M rows) with holes and need to randomly select the rows. rand() is slow and the other methods i've found are difficult to implement/understand and won't work given the holes aren't constant. i've learned that you can fake a "row_number" function but once this is in place, how do i select a certain row?

here is my query.
select @i:=@i+1 as iterator, t.* from big_table as t, (select @i:=0) as foo
i am unable to add "where iterator = 'some number' " at the end of this. Is there a way I can do this?
 

« first day (1974 days earlier)      last day (684 days later) »