The random tag has no wiki summary.
0
votes
1answer
152 views
MySQL non-sequential primary key of certain length
what's the best way to create a non-sequential primary key of a certain length in MySQL?
I'm looking to use the primary key as a 'Pin' number which real actual human people can use to refer to the ...
1
vote
1answer
259 views
Create unique numeric token on PostgreSQL
I have a database where I want to generate unique tokens of six numeric characters. These tokens should be generated each time an invoice number is inserted in the invoice_no column. This would mean ...
8
votes
2answers
311 views
How can I generate a random bytea
I would like to be able to generate random bytea fields of arbitrary length (<1Gb) for populating test data.
What is the best way of doing this?
2
votes
2answers
782 views
How to create column in DB with default value random string
Can I create column in DB table (PostgreSQL) which have default value random string, and how ?
If is not possible, please let me know that.
2
votes
1answer
156 views
Postgres - how to randomize two columns in a table
I have a table of User data which I would like to disguise/anonymize. Two of the columns have location data (e.g. lat and long, both BigDecimals).
I have anonymized all the names and other ...
7
votes
4answers
2k views
How do I do a complex GROUP BY in MySQL?
I have a table that contains several keys into other tables (where each key is comprised of multiple columns). I would like to be able to group rows together that have an equal key, but I don't want ...
3
votes
1answer
2k views
How do I make MySQL auto increment in random order?
I have a table that contains several keys into other tables (where each key is comprised of multiple columns). I would like to create a new column for each key that would be an integer such that ...
3
votes
1answer
1k views
How can I assign different random values to each row in a SELECT statement?
Please look at this code:
create table #t1(
id int identity (1,1),
val varchar(10)
);
insert into #t1 values ('a');
insert into #t1 values ('b');
insert into #t1 values ('c');
insert into #t1 ...