Hornung chris.horn...@klaviyo.com
To: MySql mysql@lists.mysql.com
Sent: Monday, 23 March, 2015 18:20:36
Subject: duplicate rows in spite of multi-column unique constraint
Hello,
I'm come across a situation where a table in our production DB has a
relatively small number of duplicative rows
a trailing space or similar 'invible'
character that makes it not identical.
- Original Message -
From: Chris Hornungchris.horn...@klaviyo.com
To: MySqlmysql@lists.mysql.com
Sent: Monday, 23 March, 2015 18:20:36
Subject: duplicate rows in spite of multi-column unique constraint
Hello,
I'm
Hi Chris,
On 3/24/2015 10:07 AM, Chris Hornung wrote:
Thanks for the suggestions regarding non-printing characters, definitely
makes sense as a likely culprit!
However, the data really does seem to be identical in this case:
mysql select id, customer_id, concat('-', group_id, '-') from
Hello,
I'm come across a situation where a table in our production DB has a
relatively small number of duplicative rows that seemingly defy the
unique constraint present on that table.
We're running MySQL 5.6.19a via Amazon RDS. The table in question is
~250M rows.
`show create table
=
I want the url is unique when inserting it.
I googled and found
http://stackoverflow.com/questions/6800866/how-to-store-urls-in-mysql
this post suggests use md5 of url. But in theory, there will be
conflict that two different urls will have the same md5(even it's
probablitiy
.
-Original Message-
From: Dan Nelson [mailto:dnel...@allantgroup.com]
Sent: Tuesday, November 05, 2013 7:56 AM
To: Li Li
Cc: mysql@lists.mysql.com
Subject: Re: how to create unique key for long varchar?
In the last episode (Nov 05), Li Li said:
I want to create a table with a long
I prefer your solution in that it's something like Optimistic Locking.
but the problem is that if I define md5 as unique key and there exists
2 different urls with the same md5. I can't insert the second url
anymore
On Tue, Nov 5, 2013 at 11:55 PM, Dan Nelson dnel...@allantgroup.com wrote
:
I prefer your solution in that it's something like Optimistic Locking.
but the problem is that if I define md5 as unique key and there exists
2 different urls with the same md5. I can't insert the second url
anymore
On Tue, Nov 5, 2013 at 11:55 PM, Dan Nelson dnel...@allantgroup.com
wrote
is that if I define md5 as unique key and there exists
2 different urls with the same md5. I can't insert the second url
anymore
On Tue, Nov 5, 2013 at 11:55 PM, Dan Nelson dnel...@allantgroup.com wrote:
In the last episode (Nov 05), Li Li said:
I want to create a table with a long varchar column
hi all
I want to create a table with a long varchar column, maybe it's the url.
according to dns spec, the url's max length is fixed. but I have
to deal with url having long params such as
a.html?q=fl=
I want the url is unique
I have a MySQL table (call it, say, item_spine) which contains three
fields which, together, form a unique key. These three fields are a
guid, a start date and an end date. The guid is alphanumeric (a
fixed-length six characters) and the dates are ISO format dates
(-MM-DD).
I also have
.)
Let's see the SELECTs that will be hitting the tables. Then we can discuss in
more detail.
-Original Message-
From: Mark Goodge [mailto:m...@good-stuff.co.uk]
Sent: Monday, July 16, 2012 8:09 AM
To: mysql
Subject: Unique index - opinions sought
I have a MySQL table (call
On 16/07/2012 17:39, Rick James wrote:
How many rows? If 1K, it does not matter. If 1 billion, we need to
discuss in more detail. Let's assume 1M...
Around 1M in the item_spine table and 10M in item_detail.
Dates should be stored in DATE datatype, which is 3 bytes. Your GUID
is
...@good-stuff.co.uk]
Sent: Monday, July 16, 2012 10:13 AM
To: Mysql General List
Subject: Re: Unique index - opinions sought
On 16/07/2012 17:39, Rick James wrote:
How many rows? If 1K, it does not matter. If 1 billion, we need to
discuss in more detail. Let's assume 1M...
Around 1M
Hi,
If I use NULL UNIQUE when I create a table, it seems that only one
NULL entry is allowed. Since NULL could mean unknown, in this case,
two unknowns are not the same and I want to allow multiple nulls but I
still want non null entries be unique. Is there a construct in mysql
that can create
Hi,
On 17-10-2011 15:39, Peng Yu wrote:
If I use NULL UNIQUE when I create a table, it seems that only one
NULL entry is allowed. Since NULL could mean unknown, in this case,
two unknowns are not the same and I want to allow multiple nulls but I
still want non null entries be unique
Assign each server a number and prefix/append that number to the unique
ID.
I will suggest you above, append -A for first machine and -B for
second machine.
-Prabhat
On Thu, Jul 21, 2011 at 12:13 PM, Daevid Vincent dae...@daevid.com wrote:
I can think of several ways to accomplish
Hi there,
I need a technical help fro you,
I have developed a software for college school. Here we have concept called
register number/admission number. These are two unique umber for each student.
My application resides Client/server model.
These numbers will be generated (some defined
mysql@lists.mysql.com
Sent: Thursday, 21 July 2011 12:06 PM
Subject: Re: Next Unique Number - Generation
Hi
in ur database define the 2 numbers as auto increment.
Neil Martins Exactus Corporation Pvt. Limited ISO 9001:2000 certified 1st
floor, Raheja Plaza, LBS Marg, Ghatkopar (West), Mumbai 400
I can think of several ways to accomplish this (or close to it).
* Assign each server a number and prefix/append that number to the unique
ID.
* initialize each table on each server at a different huge number so they
don't ever collide:
ALTER TABLE `students` AUTO_INCREMENT
-Original Message-
From: vegiv...@gmail.com [mailto:vegiv...@gmail.com] On Behalf Of Johan De
Meersman
Sent: Friday, January 21, 2011 1:22 AM
To: Anthony Pace
Cc: Michael Dykman; mysql.
Subject: Re: best way to have a unique key
I have to say, something similar was my first thought, too
, uuid() should be a
Universal Unique IDentifier. It's afaik a random 128-bit number; given the
space to choose from it should be rather unique. I have to admit that I'm
not entirely confident about that myself, either, though: as Pratchett put
it, one-in-a-million chances tend to pop up nine times
-Original Message-
From: Michael Dykman [mailto:mdyk...@gmail.com]
Sent: Friday, January 21, 2011 11:35 AM
To: Johan De Meersman
Cc: Anthony Pace; mysql.
Subject: Re: best way to have a unique key
One of the components of the UUID is drawn form the mac address of the
server.. While
On Friday, January 21, 2011 09:23:47 am Jerry Schwartz wrote:
[JS] A UUID (what Microsoft calls a GUID) is based in part on the MAC
address of the generating device. Since MAC addresses are supposed to be
unique across the known universe, so should a UUID.
Not entirely true - and even
Due to certain reasons, the company I am doing business with has decided
that the primary key, for an orders table, be a unique key; however, I
don't like the possibility of it conflicting if moved to another machine.
What are some pitfalls of using a unique key, that is generated by a
server
uuid()
Krishna
On Fri, Jan 21, 2011 at 12:02 AM, Anthony Pace anthony.p...@utoronto.cawrote:
Due to certain reasons, the company I am doing business with has decided
that the primary key, for an orders table, be a unique key; however, I don't
like the possibility of it conflicting if moved
Dude, come on. I know that all primary keys have to be unique; however,
I was obviously referring to the use of uuid over auto incrementation.
On 1/20/2011 1:36 PM, Michael Dykman wrote:
It is axiomatic in the relational model that a primary must be unique.
This is not a quirk put forth
I know of uuid() my problem is that there can be conflicts when copying
the DB to a different machine, or working with sections of the db on
different machines for load balancing.
On 1/20/2011 1:44 PM, Krishna Chandra Prajapati wrote:
Please keep in mind this variable will also be displayed
Although I did berate you for your obvious cheek, I will of course
complement the acuteness of your response.
On 1/20/2011 2:10 PM, Anthony Pace wrote:
Dude, come on. I know that all primary keys have to be unique;
however, I was obviously referring to the use of uuid over auto
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
What conflicts are you expecting? according to the documentation:
A UUID is designed as a number that is globally unique in space and
time. Two calls to UUID() are expected to generate two different
values, even if these calls are performed on two
I should have read more carefully.. I apologize for my snap response.
At a guess: as I recall, under M$ SQLServer the typical (only?) form
of unique identifier used is something very UUID-like. MY information
might be dated. I was certified as a SQL Server administrator perhaps
12 years agoI
http://www.mysqlperformanceblog.com/2007/03/13/to-uuid-or-not-to-uuid/
-Original Message-
From: Krishna Chandra Prajapati [mailto:prajapat...@gmail.com]
Sent: Thursday, January 20, 2011 10:45 AM
To: Anthony Pace
Cc: mysql.
Subject: Re: best way to have a unique key
uuid
I have to say, something similar was my first thought, too - you never
mention uuid in your original post. As already stated, uuid() should be a
Universal Unique IDentifier. It's afaik a random 128-bit number; given the
space to choose from it should be rather unique. I have to admit that I'm
Based on my reply below, do you recommend I continue to have these indexes ?
-- Forwarded message --
From: Tompkins Neil neil.tompk...@googlemail.com
Date: Wed, Oct 13, 2010 at 8:22 PM
Subject: Re: Primary key not unique on InnoDB table
To: Travis Ard travis_...@hotmail.com
Cc
not unique on InnoDB table
Based on my reply below, do you recommend I continue to have these indexes ?
-- Forwarded message --
From: Tompkins Neil neil.tompk...@googlemail.com
Date: Wed, Oct 13, 2010 at 8:22 PM
Subject: Re: Primary key not unique on InnoDB table
To: Travis Ard
I've the following table. But why isn't the primary key unique, e.g.
preventing duplicates if entered ?
CREATE TABLE `players_master` (
`players_id` bigint(20) NOT NULL AUTO_INCREMENT,
`default_teams_id` bigint(20) NOT NULL,
`first_name` varchar(100) COLLATE utf8_unicode_ci NOT NULL
neil.tompk...@googlemail.com escreveu na mensagem
news:aanlkti=-1wvuxdfsq4km6rfz0wsrlpphug1bnt4x9...@mail.gmail.com...
I've the following table. But why isn't the primary key unique, e.g.
preventing duplicates if entered ?
CREATE TABLE `players_master` (
`players_id` bigint(20) NOT NULL
=-1wvuxdfsq4km6rfz0wsrlpphug1bnt4x9...@mail.gmail.com...
I've the following table. But why isn't the primary key unique, e.g.
preventing duplicates if entered ?
CREATE TABLE `players_master` (
`players_id` bigint(20) NOT NULL AUTO_INCREMENT,
`default_teams_id` bigint(20) NOT NULL,
`first_name` varchar(100
Hi Neil,
Yes, primary key is always unique.
In your case, you are using composite key (players_id,default_teams_id).
_Krishna
On Wed, Oct 13, 2010 at 8:07 PM, Tompkins Neil neil.tompk...@googlemail.com
wrote:
I've the following table. But why isn't the primary key unique, e.g.
preventing
single primary key. Am I wrong?
--
João Cândido de Souza Neto
Tompkins Neil neil.tompk...@googlemail.com escreveu na mensagem
news:aanlkti=-1wvuxdfsq4km6rfz0wsrlpphug1bnt4x9...@mail.gmail.com...
I've the following table. But why isn't the primary key unique, e.g.
preventing duplicates
field it must be your
single primary key. Am I wrong?
--
João Cândido de Souza Neto
Tompkins Neil neil.tompk...@googlemail.com escreveu na mensagem
news:aanlkti=-1wvuxdfsq4km6rfz0wsrlpphug1bnt4x9...@mail.gmail.com...
I've the following table. But why isn't the primary key unique, e.g
neil.tompk...@googlemail.com escreveu na mensagem
news:aanlkti=-1wvuxdfsq4km6rfz0wsrlpphug1bnt4x9...@mail.gmail.com...
I've the following table. But why isn't the primary key unique, e.g.
preventing duplicates if entered ?
CREATE TABLE `players_master` (
`players_id` bigint(20
Of course, sorry totally stupid should I recognised that.
Thanks
Neil
On Wed, Oct 13, 2010 at 3:46 PM, Krishna Chandra Prajapati
prajapat...@gmail.com wrote:
Hi Neil,
Yes, primary key is always unique.
In your case, you are using composite key (players_id,default_teams_id).
_Krishna
On 10/13/2010 10:37 AM, Tompkins Neil wrote:
I've the following table. But why isn't the primary key unique, e.g.
preventing duplicates if entered ?
CREATE TABLE `players_master` (
`players_id` bigint(20) NOT NULL AUTO_INCREMENT,
`default_teams_id` bigint(20) NOT NULL,
`first_name
On 10/13/2010 11:37 AM, Tompkins Neil wrote:
Shawn, sorry my error, I didn't realise I had two fields as the primary key
That's misinformation. You can have multiple fields as a primary key.
Show us what you think is duplicate data and I may be able to help you
fix your definition
--
Shawn it is fine. I thought my primary key was just 1 field.
On Wed, Oct 13, 2010 at 4:44 PM, Shawn Green (MySQL)
shawn.l.gr...@oracle.com wrote:
On 10/13/2010 11:37 AM, Tompkins Neil wrote:
Shawn, sorry my error, I didn't realise I had two fields as the primary
key
That's
to
your storage requirements.
-Travis
-Original Message-
From: Tompkins Neil [mailto:neil.tompk...@googlemail.com]
Sent: Wednesday, October 13, 2010 8:37 AM
To: [MySQL]
Subject: Primary key not unique on InnoDB table
I've the following table. But why isn't the primary key unique, e.g
requirements.
-Travis
-Original Message-
From: Tompkins Neil [mailto:neil.tompk...@googlemail.com]
Sent: Wednesday, October 13, 2010 8:37 AM
To: [MySQL]
Subject: Primary key not unique on InnoDB table
I've the following table. But why isn't the primary key unique, e.g.
preventing
I may have missed what you are trying to do here. NoSQL is really a bad name
and should really be renamed to NoREL instead. NoSQL implementations are not
used just because of limitations of traditional RDBMS when it comes to sheer
traffic volume, they are also used because they scale horizontally
On Sun, Sep 12, 2010 at 9:45 PM, Kiss Dániel n...@dinagon.com wrote:
offset + increment thingy is good if you know in advance that you'll have a
limited number of servers. But if you have no idea that you will have 2,
20,
or 200 servers in your array in the future, you just can't pick an
This is actually more for failover scenarios where databases are spread in
multiple locations with unreliable internet connections. But you want to
keep every single location working even when they are cut off from the other
databases. The primary purpose is not load distribution.
On Mon, Sep 13,
Hmm, that's a very interesting scenario, indeed.
One bad connection will break the chain, though, so in effect you'll be
multiplying the disconnecting rate...
I think you'd be better of with a star topology, but MySQL unfortunately
only allows ring-types. This is gonna require some good thinking
I could be way off here, but how about letting your unique id be a
calculated column of the the server's MAC address concatenated with an
auto-increment id column?
I hope this helps...
~~Fish~~
On Mon, Sep 13, 2010 at 7:26 AM, Johan De Meersman vegiv...@tuxera.bewrote:
Hmm, that's a very
I had some coffee and realized that actually, using a UUID might be
something to look at. There have been quite a few discussions about using a
UUID as a unique id and it does have some gotchas. Just Google: mysql uuid
Have a great day
~~Fish~~
On Mon, Sep 13, 2010 at 7:30 AM, Fish
Hell, yeah. :)
Actually, the ID system I described below works quite well according to my
tests. I feel very comfortable with it both from primary key size and
dynamically increasable database number point of views.
What I actually don't like in it is the concatenated unique ID (ID + SID)
pairs
be the optimal solution
here.
On Mon, Sep 13, 2010 at 2:05 PM, Fish Kungfu fish.kun...@gmail.com wrote:
I had some coffee and realized that actually, using a UUID might be
something to look at. There have been quite a few discussions about using
a
UUID as a unique id and it does have some gotchas. Just
-Original Message-
From: Kiss Dániel [mailto:n...@dinagon.com]
Sent: Sunday, September 12, 2010 1:47 PM
To: mysql@lists.mysql.com; replicat...@lists.mysql.com
Subject: Unique ID's across multiple databases
Hi,
I'm designing a master-to-master replication architecture.
I wonder what
-Original Message-
From: vegiv...@gmail.com [mailto:vegiv...@gmail.com] On Behalf Of Johan De
Meersman
Sent: Monday, September 13, 2010 7:27 AM
To: Kiss Dániel
Cc: Max Schubert; mysql@lists.mysql.com; replicat...@lists.mysql.com
Subject: Re: Unique ID's across multiple databases
Hmm
-Original Message-
From: Kiss Dániel [mailto:n...@dinagon.com]
Sent: Monday, September 13, 2010 11:49 AM
To: Jerry Schwartz
Cc: Johan De Meersman; Max Schubert; mysql@lists.mysql.com;
replicat...@lists.mysql.com
Subject: Re: Unique ID's across multiple databases
Well, not exactly.
I do
Schubert; mysql@lists.mysql.com;
replicat...@lists.mysql.com
Subject: Re: Unique ID's across multiple databases
Well, not exactly.
I do not own all the databases. Some of them are placed at customers, some
of them are at my data warehouse. So, neither NAS or Fibre Channel is a
solution
Schwartz
Cc: Johan De Meersman; Max Schubert; mysql@lists.mysql.com;
replicat...@lists.mysql.com
Subject: Re: Unique ID's across multiple databases
Well, not exactly.
I do not own all the databases. Some of them are placed at customers, some
of them are at my data warehouse. So, neither NAS
From: Kiss Dániel [mailto:n...@dinagon.com]
Sent: Monday, September 13, 2010 3:17 PM
To: Jerry Schwartz
Cc: Johan De Meersman; Max Schubert; mysql@lists.mysql.com;
replicat...@lists.mysql.com
Subject: Re: Unique ID's across multiple databases
Well, that would be the plan, yes. :-)
Anyway, I'll
://www.mysqlperformanceblog.com/2007/03/13/to-uuid-or-not-to-uuid/
Is this UUID issue unique to mySQL or are there other RDBMS's that handle
it better (Postgress, Oracle, SQL Server, etc?)
I too have a need for a unique identifier that will mesh with other
databases periodically. So that a user in one
.
This is a good
summary about the issues:
http://www.mysqlperformanceblog.com/2007/03/13/to-uuid-or-not-to-uuid/
Is this UUID issue unique to mySQL or are there other
RDBMS's that handle
it better (Postgress, Oracle, SQL Server,
etc?)
I too have a need for a unique identifier that
will mesh
On Mon, Sep 13, 2010 at 8:59 PM, Johnny Withers joh...@pixelated.netwrote:
This sounds like a good job for a 'NoSQL' system. Maybe?
I can't help but blink at that. How exactly is NoSQL going to fix issues
that are related to topology, not inherent SQL limitations ? Which
particular
Hi,
I'm designing a master-to-master replication architecture.
I wonder what the best way is to make sure both databases generate unique
row ID's, so there won't be ID conflicts when replicating both directions.
I read on forums about pro's and con's using UUID's, also about setting the
*auto
On 12 Sep 2010, at 19:47, Kiss Dániel wrote:
- SID adds only 2 bytes in this case to the size of the primary key item.
It can be even 1 byte if I'm sure I'll never exceed maximum 255 servers. But
anyhow, it is still way smaller than the 16 byte of a UUID field, even if
using BIGINT's.
Server offset + increment works really well, is simple, and well
documented and reliable - not sure why you would want to re-invent
something that works so well :).
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
You may be right. I'm not arguing that offset + increment is working.
I'm just wondering if that's the optimal solution when you do not know how
many servers you will have in your array in the future. In my view, the
offset + increment thingy is good if you know in advance that you'll have a
hello, i have a mysql database that stores URL's in a table now i
would like to change the schema so that the URL's are unique so my
question is: is it appropriate to use URL's as a unique IDs if not
what are the alternatives?
any advise much appreciated
norman
--
˙uʍop ǝpısdn p,uɹnʇ pןɹoʍ ǝɥʇ
Hi All,
I have a table that uses auto_increment to generate the Id automatically
working fine. However, I need to create a new table where the Id must be a
number generated randomly, so I cannot use the auto_increment.
MySQL has a function RAND. So I could use something like this:
SELECT
If your specs are that specific (IDs must be between 1 and 99)
then you could create a 99-row table with one integer column and
prefill it with the numbers 1 to 99 in random order.
Then you could write a function that would select and return the first
number in the table, then delete
-Original Message-
From: Jim Lyons [mailto:jlyons4...@gmail.com]
Sent: May 28, 2010 11:49 AM
To: Andre Matos
Cc: mysql@lists.mysql.com
Subject: Re: Using RAND to get a unique ID that has not been used yet
If your specs are that specific (IDs must be between 1 and 99)
then you could create
[mailto:jlyons4...@gmail.com]
Sent: May 28, 2010 11:49 AM
To: Andre Matos
Cc: mysql@lists.mysql.com
Subject: Re: Using RAND to get a unique ID that has not been used yet
If your specs are that specific (IDs must be between 1 and 99)
then you could create a 99-row table with one integer
-Original Message-
From: Jim Lyons [mailto:jlyons4...@gmail.com]
Sent: Friday, May 28, 2010 11:49 AM
To: Andre Matos
Cc: mysql@lists.mysql.com
Subject: Re: Using RAND to get a unique ID that has not been used yet
If your specs are that specific (IDs must be between 1 and 99)
then you
-Original Message-
From: Andre Matos [mailto:andrema...@mineirinho.org]
Sent: Friday, May 28, 2010 1:44 PM
To: Steven Staples
Cc: mysql@lists.mysql.com
Subject: Re: Using RAND to get a unique ID that has not been used yet
It seems to be a good approach, although I was trying to get
When I mentioned having everything in the Query, I was thinking about this. I
don't want to have a loop repeating the query until I get a unique Id. This is
ridicules and imagine how many queries I might end up running. No way!
Thanks for the warning and feedback!
Andre
--
Andre Matos
andrema
On Fri, May 28, 2010 at 11:38 AM, Andre Matos andrema...@mineirinho.org wrote:
I have a table that uses auto_increment to generate the Id automatically
working fine.
However, I need to create a new table where the Id must be a number generated
randomly, so I cannot use the auto_increment.
it might speed up as the used
rows are progressively deleted).
It has the advantage that the random function is called only once: whereas
using a single table requires looping until a unique random value is found,
and as the table fills this will get really slow.
- Original Message
Hi,
On Sun, Feb 21, 2010 at 1:42 PM, mos mo...@fastmail.fm wrote:
I am loading 35 million rows of data into an empty MyISAM table. This table
has 1 primary key (AutoInc) and 1 unique index and 2 non-unique indexes.
Is it going to be any faster if I remove the indexes from the table before
...@fastmail.fm wrote:
I am loading 35 million rows of data into an empty MyISAM table. This
table
has 1 primary key (AutoInc) and 1 unique index and 2 non-unique indexes.
Is it going to be any faster if I remove the indexes from the table
before
loading the data, load the data, then do
I am loading 35 million rows of data into an empty MyISAM table. This table
has 1 primary key (AutoInc) and 1 unique index and 2 non-unique indexes.
Is it going to be any faster if I remove the indexes from the table before
loading the data, load the data, then do an Alter Table .. add index
other sources).
Don't forget to set the MyISAM sort buffer size high while you create
the indexes.
/ Carsten
mos skrev:
I am loading 35 million rows of data into an empty MyISAM table. This
table has 1 primary key (AutoInc) and 1 unique index and 2 non-unique
indexes.
Is it going to be any
16
Banana
MH
17
Mango
KA
18
Orange
MP
19
Jackfruit
AP
20
Apple
TN
From the above table, I want a SQL query which will list me the unique fruits
and the states in which they are grown, like:
Apple: KA, MH, TN
Banana: TN, AP, MP, MH
Jackfruit: MH,MP,AP
Mango: MP, KA
Orange: AP,MH
Banana
TN
10
Apple
MH
11
Jackfruit
AP
12
Orange
MH
13
Mango
KA
14
Apple
TN
15
Banana
MP
16
Banana
MH
17
Mango
KA
18
Orange
MP
19
Jackfruit
AP
20
Apple
TN
From the above table, I want a SQL query which will list me the unique fruits
and the states in which
CREATE TABLE darwincoredata;
CREATE TABLE `darwincoredata` (
`ID` int(10) NOT NULL auto_increment,
`CatalogNumber` varchar(20) NOT NULL,
[...more...],
PRIMARY KEY (`ID`),
UNIQUE KEY `CatalogNumber` (`CatalogNumber`),
UNIQUE KEY `GlobalUniqueIdentifier` (`GlobalUniqueIdentifier`),
KEY
- is there a way to know it from the first
query?
I also posted this question on Stack Overflow [ http://stackoverflow.com/questions/1486068/which-unique-key-is-hit-with-my-insert
], but I want to check whether this is the best answer. If anything
new comes up here, I will also put in on the Stack
I'm trying to formulate a query on a Wordpress database that will give
me the highest 'object_id' with the highest 'term_taxonomy_id',
something like:
+-+--+
| max(distinct object_id) | term_taxonomy_id |
+-+--+
Message -
From: Eric Anderson e...@macandbumble.com
To: mysql@lists.mysql.com
Sent: Tuesday, October 20, 2009 3:42 PM
Subject: Distinct max() and separate unique value
I'm trying to formulate a query on a Wordpress database that will give me
the highest 'object_id' with the highest
On Tue, 20 Oct 2009, DaWiz wrote:
I would try:
select max(object_id), term_taxonomy_id
group by term_taxonomy_id
order by term_taxonomy_id;
max(column) returns a single value so distinct is not needed.
The group by and order by should only have columns thaqt are displayed and
that are not
- Original Message -
From: Eric Anderson ke...@on-e.com
To: mysql@lists.mysql.com
Sent: Tuesday, October 20, 2009 4:05 PM
Subject: Re: Distinct max() and separate unique value
I'm trying to formulate a query on a Wordpress database that will give
me the highest 'object_id
Are UNIQUE KEY UNIQUE INDEX two ways of specifying the same thing? If
not, what are the differences?
Feel free to tell me to RTFM but please post manual chapters. I've been
looking but haven't been able to find anything.
--
MySQL General Mailing List
For list archives: http
At 09:13 AM 7/30/2009, b wrote:
Are UNIQUE KEY UNIQUE INDEX two ways of specifying the same thing? If
not, what are the differences?
Feel free to tell me to RTFM but please post manual chapters. I've been
looking but haven't been able to find anything.
They are the same thing. If you
Hi !
mos wrote:
At 09:13 AM 7/30/2009, b wrote:
Are UNIQUE KEY UNIQUE INDEX two ways of specifying the same thing?
If not, what are the differences?
Feel free to tell me to RTFM but please post manual chapters. I've
been looking but haven't been able to find anything.
They are the same
On 07/30/2009 02:23 PM, Joerg Bruehe wrote:
Hi !
mos wrote:
At 09:13 AM 7/30/2009, b wrote:
Are UNIQUE KEY UNIQUE INDEX two ways of specifying the same thing?
If not, what are the differences?
Feel free to tell me to RTFM but please post manual chapters. I've
been looking but haven't been
NOT NULL,
current_timestamp TIMESTAMP,
primary key (id)
);
I will not use auto_increment
Is there other way to generate unique primary key in MySQL?
Thank you
--
Jim Lyons
Web developer / Database administrator
http://www.weblyons.com
I wish my id has the same length,auto_increment can do this?
I have a idear to generate unique primary key:
select concat(cast(unix_timestamp() as char) , cast(substr(rand(),3,4) as
char(4)));
Is this ok? any good idear?
Your routine does not really guarantee uniqueness, If you mean
unique primary key in MySQL?
Thank you
BTW,i am using MySQL 5.0
.
SELECT uuid();
and produces a guaranteed unique 36 character sitrng, but this might
not be very efficient in joins as your dataset grows.
- michael dykman
On Tue, Apr 28, 2009 at 12:59 AM, yuan edit edit.y...@gmail.com wrote:
I have a shopping cart table like this:
CREATE TABLE
1 - 100 of 642 matches
Mail list logo