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
app_cu
p_customergroupmembership
where customer_id ='ajEiQA';
I suspect one of those group IDs has a trailing space or similar 'invible'
character that makes it not identical.
- Original Message -
From: "Chris Hornung"
To: "MySql"
Sent: Monday, 23 M
-- Original Message -
> From: "Chris Hornung"
> To: "MySql"
> 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 D
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 cr
king.
> 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 wrote:
>> In the last episode (Nov 05), Li Li said:
>>&g
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
&g
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 wrote:
> In the last ep
.
> -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:
> >
aaa&fl=....
> 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 differ
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
ssage-
> From: Mark Goodge [mailto:m...@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
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 non-standa
ables.)
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 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
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
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
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 wrote:
> I can think of several ways to accomplish this (or cl
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_INCR
: 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 086 India T: (9122)
66505900 F: (9122) 22040826 Url:www.exactuscorp.com
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 def
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 enti
>-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 ma
uld 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
>-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, som
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&
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 un
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
-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
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
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
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 by
uuid()
Krishna
On Fri, Jan 21, 2011 at 12:02 AM, Anthony Pace wrote:
> 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 a
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
s
ct: Fwd: Primary key not unique on InnoDB table
Based on my reply below, do you recommend I continue to have these indexes ?
-- Forwarded message --
From: Tompkins Neil
Date: Wed, Oct 13, 2010 at 8:22 PM
Subject: Re: Primary key not unique on InnoDB table
To: Travis Ard
Cc: &q
Based on my reply below, do you recommend I continue to have these indexes ?
-- Forwarded message --
From: Tompkins Neil
Date: Wed, Oct 13, 2010 at 8:22 PM
Subject: Re: Primary key not unique on InnoDB table
To: Travis Ard
Cc: "[MySQL]"
Hi Travis,
Thanks for you
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 i
and add 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 pri
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
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
--
Shaw
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,
`
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 (player
have an auto_increment field it must be your
> > > single primary key. Am I wrong?
> > >
> > > --
> > > João Cândido de Souza Neto
> > >
> > > "Tompkins Neil" escreveu na mensagem
> > > news:aanlkti=-1wvuxdfsq4km6rfz0wsr
r as I know, if you have an auto_increment field it must be your
> > single primary key. Am I wrong?
> >
> > --
> > João Cândido de Souza Neto
> >
> > "Tompkins Neil" escreveu na mensagem
> > news:aanlkti=-1wvuxdfsq4km6rfz0wsrlpphug1b
w, if you have an auto_increment field it must be your
> > single primary key. Am I wrong?
> >
> > --
> > João Cândido de Souza Neto
> >
> > "Tompkins Neil" escreveu na mensagem
> > news:aanlkti=-1wvuxdfsq4km6rfz0wsrlpphug1bnt4x9...@m
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 wrote:
> I've the following table. But why isn't the primary key unique, e.g.
> preventing dupli
veu 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` bi
Neil" 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_
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_c
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 v
On Mon, Sep 13, 2010 at 8:59 PM, Johnny Withers wrote:
>
> 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 incarnation of NoSQL are you
ession) is
>> kind of
a suicide, when it comes to performance.
>> 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 be
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&quo
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,
M
> >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 not own all the databases. Some o
artz
> >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
>-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 data
;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 multip
>-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
>-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-maste
ust be the optimal solution
here.
On Mon, Sep 13, 2010 at 2:05 PM, Fish Kungfu 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 gotcha
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)
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
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 wrote:
> Hmm, that's a very interes
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
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,
On Sun, Sep 12, 2010 at 9:45 PM, Kiss Dániel 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 optimal
>
What b
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
limit
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:http://lists.mysql.com/mysql?unsub=
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
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
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
h time (in fact 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.
- O
On Fri, May 28, 2010 at 11:38 AM, Andre Matos 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.
You'd be better off usin
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
an
>-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,
>-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
;
>
>
>> -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 you
> -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
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 t
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 FLOO
> > 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 th
Hi,
On Sun, Feb 21, 2010 at 1:42 PM, mos 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
&
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 b
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
A
9
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 t
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 they are grown, like:
Apple: KA, MH, TN
Banana: TN, AP, MP, MH
Jackfruit: MH,MP,AP
Mango:
HOW 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`),
RIMARY"
AND Seq_in_index = '2';
But this is an extra query - 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
- Original Message -
From: "Eric Anderson"
To:
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' with the
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 agg
Message -
From: "Eric Anderson"
To:
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 'term
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 |
+-+--+
|
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 hav
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 hav
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
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
>> 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
t; ...
> user_id INT 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
ed ie.
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 wrote:
> I have a shopping cart table like this:
>
> CREATE TABLE shopping_cart
BTW,i am using MySQL 5.0
1 - 100 of 657 matches
Mail list logo