Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Database > SQL Language
SQL Language SQL Language discussions not specific to a particular RDBMS program or vendor.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Language section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old July 28th, 2008, 09:45 PM
Authorized User
Join Date: May 2008
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default column uniqueness that trim's trailing whitespace?

I currently have a table with 3 columns required for uniqueness, using the following:
    UNIQUE KEY `transDate_desc_amount` (`transaction_date`,`description`,`amount`)

The issue I am finding is that some of the "description" column data has snuck into the database with trailing white space. Hence I'm wondering whether a good way to avoid duplicates being created is to have the constraint know about ignoring white space?

Do you know if this is possible?

e.g. something like UNIQUE KEY `transDate_desc_amount` (`transaction_date`,TRIM(`description`),`amount`)


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I keep leading and trailing whitespaces? 2BOrNot2B XSLT 2 October 31st, 2008 11:35 AM
Uniqueness of LoginStatus controls roman BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 4 June 25th, 2008 05:01 PM
SQL - removing trailing zeros skywalker1981 SQL Server 2000 4 April 1st, 2008 08:32 AM
Remove Leading and Trailing Zeros lene_wee SQL Server 2000 3 April 1st, 2008 08:23 AM
Remove the trailing whitespace ksskumar XSLT 1 October 13th, 2006 06:23 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.