How can I select 2 different random rows from a table?
问题 right now I have row=session.query(Item).order_by(func.random()).limit(2) name1=row[0].name name2=row[1].name Which gives me the first column(name) of each entry. The problem is, I get multiples (it will select the same random row twice. I want it to always be different. Is there a way to do this without an if, then statement? if its useful, when I print row, it gives me something like this: SELECT items.id AS items_id, items.name AS items_name, items.data AS items_data FROM items ORDER BY