Posts Topics Forums Images
Search videos from message boards Videos Search messages from microblogs Microblogs Search messages from imdb.com Imdb Search messages from yuku.com Yuku
My account: Login | Sign Up
Loading... 

Mysql 'distinct' (unique) | Thread profile

Thread profile page for "Mysql 'distinct' (unique)" on http://www.overclockers.co.uk. This report page is a snippet summary view from a single thread "Mysql 'distinct' (unique)", located on the Message Board at http://www.overclockers.co.uk. This thread profile page shows the thread statistics for: Total Authors, Total Thread Posts, and Thread Activity, which are reported in a table below. Additional thread profile information is also shown in the following ways:

1) Top Contributing Authors
2) Related Threads on "eBay Auctions"
3) Related Threads on Other Sites

Warning: These statistics are generated using 'best efforts' and can experience delays and reporting errors at times. Please note that such statistics do not constitute a thread's popularity and/or exact posting volumes at any given reporting period.

Title: Mysql 'distinct' (unique)
Site: Overclockers UK Forums  Overclockers UK Forums - site profile
Forum: HTML, Graphics & Programming  HTML, Graphics & Programming - forum profile
Total authors: 2 authors
Total thread posts: 5 posts
Thread activity: no new posts during last week
Domain info for: overclockers.co.uk

Thread posts in Mysql 'distinct' (unique):

1. 
Started 2 years ago (2007-06-22 13:48:00)  by jdickerson
I have a table with three fields: "id", "desc" and "db". I want "id" and "db" to be the composite primary key, however the table as it stands at the moment is not unique. I want to create a new table with only unique values. The difficulties I'm having is id on its own doesn't have to be unique, neither does db on its own... it is the id/db combination that is unique. Any ...
Size: 515 bytes
Customize:  Customize "Mysql 'distinct' (unique) :: HTML, Graphics & Programming :: Overclockers UK Forums"
2. 
Started 2 years ago (2007-06-22 14:26:00)  by matja
how about fixing the values in your current table so that they are unique composite primary keys, and running 'alter table t add primary key (id, db);'? If you have to do it with minimal downtime, you could create a new table with an identical definition, insert...select the rows from old to new, fix the values, alter the primary key, drop the original, and "alter table...rename" the new ...
Size: 498 bytes
Customize:  Customize "<b>Reply 1</b>: Mysql 'distinct' (unique) :: HTML, Graphics & Programming :: Overclockers UK Forums"
3. 
Started 2 years ago (2007-06-22 14:48:00)  by jdickerson
Quote: Originally Posted by matja Or am i getting the wrong idea... Nope, you've not got the wrong idea. But, Quote: Originally Posted by matja how about fixing the values in your current table so that they are unique composite primary keys Is what I'm stuck on. ...
Size: 1,262 bytes
Customize:  Customize "<b>Reply 2</b>: Mysql 'distinct' (unique) :: HTML, Graphics & Programming :: Overclockers UK Forums"
4. 
Started 2 years ago (2007-06-22 16:27:00)  by matja
you could use concat() and seperate the column values with a value which doesn't appear in the data - eg : select distinct concat(id,'|',db) from t;
Size: 161 bytes
Customize:  Customize "<b>Reply 3</b>: Mysql 'distinct' (unique) :: HTML, Graphics & Programming :: Overclockers UK Forums"
5. 
Started 2 years ago (2007-06-22 21:13:00)  by jdickerson
Quote: Originally Posted by matja you could use concat() and seperate the column values with a value which doesn't appear in the data - eg : select distinct concat(id,'|',db) from t; I can use the above to build a new table and I can include the missing column (desc) Cheers EDIT -Can anyone make the below ...
Size: 1,416 bytes
Customize:  Customize "<b>Reply 4</b>: Mysql 'distinct' (unique) :: HTML, Graphics & Programming :: Overclockers UK Forums"
 

Top contributing authors for Mysql 'distinct' (unique)

Name
Posts
jdickerson
3
user's latest post:
Mysql 'distinct' (unique)
Published (2007-06-22 21:13:00)
Quote: Originally Posted by matja you could use concat() and seperate the column values with a value which doesn't appear in the data - eg : select distinct concat(id,'|',db) from t; I can use the above to build a new table and I can include the missing column (desc) Cheers EDIT -Can anyone make the below syntaxically correct? db_ref has &quot;id, db and def&quot;, db_reg_bck has &quot;id, db&quot; but no def....
matja
2
user's latest post:
Mysql 'distinct' (unique)
Published (2007-06-22 16:27:00)
you could use concat() and seperate the column values with a value which doesn't appear in the data - eg : select distinct concat(id,'|',db) from t;