Author Topic: About query rotation.  (Read 763 times)

radiokemonia

  • Jr. Member

  • Offline
  • **
  • 75
About query rotation.
« on: December 14, 2017, 07:22:20 PM »
Dear friends..a little help for me.I would create an sql query rotation by years. In practic i would to play track with hygh random enforce roule tracks from 1980 to 1990.I do not create it. An guru of sql would help me? THanks!!!!!

Jhonny

  • Hero Member

  • Offline
  • *****
  • 4160
  • Personal Text
    Peace, enjoy life, last sleep is longer than live!
    • Jhonny's RadioDJ tutorials.
Re: About query rotation.
« Reply #1 on: December 15, 2017, 06:52:59 AM »
From Guru Marius.

Code: [Select]
-- ADD 3 TRACKS WITH SWEEPER FROM 1980 TO 1990
 SELECT ID, year, path FROM songs WHERE $ForceRepeatRules$ AND year >='1979' and year < '1991' ORDER BY rand() LIMIT 3; $SweeperOnStart$


R.T.F.M. means to me, Read The Fantastic Messages.
Einstein says: Make things simple, but don't make simple things simpler! (wise) this is just my life lesson you know.

I don't do drugs, I do tuts. ( ͡° ͜ʖ ͡°) visit  https://radiodj.info

Testing RadioDJ v2.0.3.6 Beta

radiokemonia

  • Jr. Member

  • Offline
  • **
  • 75
Re: About query rotation.
« Reply #2 on: December 15, 2017, 09:10:17 PM »
Thanks jhonny...i try this script but do not work...radiodj respond with error...

Jhonny

  • Hero Member

  • Offline
  • *****
  • 4160
  • Personal Text
    Peace, enjoy life, last sleep is longer than live!
    • Jhonny's RadioDJ tutorials.
Re: About query rotation.
« Reply #3 on: December 16, 2017, 09:37:09 AM »
And this one from a noob. :hihi:
Code: [Select]
SELECT ID, year, path FROM songs WHERE $TrackRepeatInterval$ AND year >='1979' and year < '1991' ORDER BY rand() LIMIT 3;

Or

Code: [Select]
SELECT ID, year, path FROM songs WHERE $ArtistRepeatInterval$ AND year >='1979' and year < '1991' ORDER BY rand() LIMIT 3;

Or

Code: [Select]
SELECT ID, year, path FROM songs WHERE $ArtistRepeatInterval$ AND $TrackRepeatInterval$ AND year >='1979' and year < '1991' ORDER BY rand() LIMIT 3;
R.T.F.M. means to me, Read The Fantastic Messages.
Einstein says: Make things simple, but don't make simple things simpler! (wise) this is just my life lesson you know.

I don't do drugs, I do tuts. ( ͡° ͜ʖ ͡°) visit  https://radiodj.info

Testing RadioDJ v2.0.3.6 Beta