Dataset and SQL

Hi, I’m starting to work with the dataset, and I have a doubt.

You can choose a random value from a column in dataset?

I have several messages, and would not want to display them sequentially.

I have found that there is order and filter field with SQL, but no correct results

This filter is possible?

Regards

The RAND MySQL function should be able to do what you want:

https://dev.mysql.com/doc/refman/5.0/en/mathematical-functions.html#function_rand

Assign each of your rows a number and then have Col1 = FLOOR(1 + RAND() * 9) for example - alternatively have a formula column set to your random number statement and then have Col1 = 1 in your filter

1 Like

The problem I have is that there are two columns. To provide styles with CSS, I have a column for the title and one with the text.

If I do well rand, which applies to 2 columns.

My schedule is:

Dataset1> Col1 - Col2

In each column it has four elements, but the rand should do so on the line, not on the columns.

Compared with excell, need to do rand on horizont row, not in the vertical column,

Not if I have explained correctly;)

Sorry for my bad English!

Sorry but i’m not clear what you are trying to do :smiley: RAND will only operate on rows not on columns - if you wanted to show random columns then I think the only way to do that would be to organise your dataset the other way (your rows as columns, etc)

1 Like

You’re right, changing the order would be ok!

Thanks! :wink:

1 Like