Re: MySQL RAND() Issues [was Re: How to Shuffle data]

2011-07-15 Thread Reindl Harald
Am 15.07.2011 19:40, schrieb Jan Steinman: >> From: Reindl Harald >> >> do not use any random-functions of mysql even if they exists >> http://bugs.mysql.com/bug.php?id=59253 > > So RAND() can be useful, but it is not really very random the problem is the idiotic temp table fecth a random reco

Re: MySQL RAND() Issues [was Re: How to Shuffle data]

2011-07-15 Thread Dan Nelson
In the last episode (Jul 15), Arthur Fuller said: > This would be sooo much simpler to solve in MS-SQL, given the function > NewID(), which is guaranteed to return a unique value. I have used this > in a few web sites and it works splendidly; something along the lines of > > SELECT TOP 10 *, NewI

Re: MySQL RAND() Issues [was Re: How to Shuffle data]

2011-07-15 Thread Michael Dykman
I have found this approach pretty effective: select *, rand() r from [mytable] where [condition] order by r limit 10 as long as you are aware that a random number is generated for every row in the table. - michael dykman On Fri, Jul 15, 2011 at 2:12 PM, Arthur Fuller wrote: > This would

Re: MySQL RAND() Issues [was Re: How to Shuffle data]

2011-07-15 Thread Arthur Fuller
This would be sooo much simpler to solve in MS-SQL, given the function NewID(), which is guaranteed to return a unique value. I have used this in a few web sites and it works splendidly; something along the lines of SELECT TOP 10 *, NewID() FROM User_Messages ORDER BY NewID which is guaranteed to

MySQL RAND() Issues [was Re: How to Shuffle data]

2011-07-15 Thread Jan Steinman
> From: Reindl Harald > > do not use any random-functions of mysql even if they exists > http://bugs.mysql.com/bug.php?id=59253 Of course, it depends on the desired quality of randomness needed. I'm using RAND() to select random quotations to put at the end of emails. I can easily repeat the p

Re: How to Shuffle data

2011-07-14 Thread Hal�sz S�ndor
2011/07/13 19:28 +0530, Adarsh Sharma I think a procedure can do it easily , If I know the proper function for that. Well, here is a procedure that copies from one table, strips off the leading slash-separated part and reverses it by dots, and inserts the original, the reversed

Re: How to Shuffle data

2011-07-14 Thread shawn wilson
gton Ave. > Farmington, CT 06032 > > 860.674.8796 / FAX: 860.674.8341 > E-mail: je...@gii.co.jp > Web site: www.the-infoshop.com > >>-Original Message- >>From: Adarsh Sharma [mailto:adarsh.sha...@orkash.com] >>Sent: Wednesday, July 13, 2011 9:59 AM >>To: wal...@

RE: How to Shuffle data

2011-07-14 Thread Jerry Schwartz
armington Ave. Farmington, CT 06032 860.674.8796 / FAX: 860.674.8341 E-mail: je...@gii.co.jp Web site: www.the-infoshop.com >-Original Message- >From: Adarsh Sharma [mailto:adarsh.sha...@orkash.com] >Sent: Wednesday, July 13, 2011 9:59 AM >To: wal...@waltertross.com >Cc: mysql

Re: How to Shuffle data

2011-07-13 Thread Raj Shekhar
In infinite wisdom Adarsh Sharma wrote: > Dear all, > > I have million of sites stored in url column of a mysql table. > > Some few examples are :- > > www.facebook.com/home > I want to take the output in a tsv file the sites url in the below forms : > > com.faebook.com/home > com.yourguide.a

Re: How to Shuffle data

2011-07-13 Thread shawn wilson
On Jul 13, 2011 6:41 AM, "Adarsh Sharma" wrote: > > Dear all, > > I have million of sites stored in url column of a mysql table. > > I need to shuffle the . words . Is there any in built function in mysql to achieve this. > Why would you want to do this in mysql? What's your programming language

Re: How to Shuffle data

2011-07-13 Thread Hal�sz S�ndor
2011/07/13 16:10 +0530, Adarsh Sharma www.facebook.com/home adelaide.yourguide.com/news/local/news/entertainment/cd-review-day-and-age-the-killers/1401702.aspx abclive.in/abclive_business/2393.html abclive.in/abclive_business/assocham_manufacturing_companies.html abclive.in/abclive_busine

Re: How to Shuffle data

2011-07-13 Thread Adarsh Sharma
Do i need to move output to a CSV file & then write a Java or C code for it. I think a procedure can do it easily , If I know the proper function for that. Thanks wal...@waltertross.com wrote: What you want to do is not shuffle, but reverse the domain order, starting from the TLD (top level

Re: How to Shuffle data

2011-07-13 Thread walter
What you want to do is not shuffle, but reverse the domain order, starting from the TLD (top level domain). You may pick the string functions you need from the string functions page of the manual, but the problem is that there may be any number of subdomains, so that in principle you would need a l

Re: How to Shuffle data

2011-07-13 Thread Reindl Harald
Am 13.07.2011 12:40, schrieb Adarsh Sharma: > I need to shuffle the . words . Is there any in built function in mysql to > achieve this. > > Thanks do not use any random-functions of mysql even if they exists http://bugs.mysql.com/bug.php?id=59253 signature.asc Description: OpenPGP digital