I am writing code, that returns some video on the given tag from the video, the other video with the same video. It works, but I am trying to make the results random ... so I searched and found that After some time, I found - so I tried to adjust it to my code; Here's my attempt to return a random video: And here is my code to find videos with the same code: The following method 4 selects after find out which video has the same tag: You are already grouped by Video ID, so extra sorting should not affect performance significantly. ORDER BY RAND () will be quite slow.
select r1.id, name, site, site1 from siteID as r1 JOIN (SELECT (RAND) * (SELECT MAX ( Id) from the video)) ADS R2 WHERE r1.id & gt; = R2.id LIMIT 4
select v.name, v.site, v .siteid, v.id Join Video vid video_tag vt ON vt.id_video = v.id WHERE vt.id_tag IN ('1', '2') v.id hing, however, when I keep them together If I try, I get 4 random video matching tags, I just try to get syntax errors with everyone. <<
SELECT v.name, v.site, v. Siteid, v.id video video_tag vt on vt .id_video = v.id WHERE vt.id_tag IN ('1', '2') v.id hosting group by COUNT (separate vt.id_ tag) = 2 Order Rand () Border 4;
No comments:
Post a Comment