I ran across an issue where a client had usernames that were all supposed to be lower but somehow wound up as a mixed case username.
The SQL we would use would work out something like this…

Select
Number,
Username,
LOWER(Username)
WHERE
Username != LOWER(Username)

To illustrate this here is the export specification that would return the above mentioned in TCC, name of file CandidateExportTestLower_sq.xml
Contents:

<?xml version="1.0" encoding="UTF-8"?>
<quer:query productCode="RC1501" model="http://www.taleo.com/ws/tee800/2009/01" projectedClass="Candidate" locale="en" mode="CSV" csvheader="true" largegraph="true" preventDuplicates="false" xmlns:quer="http://www.taleo.com/ws/integration/query">
	<quer:subQueries/>
	<quer:projections>
		<quer:projection>
			<quer:field path="Number"/>
		</quer:projection>
		<quer:projection>
			<quer:field path="Credentials,Username"/>
		</quer:projection>
		<quer:projection alias="UsernameLower">
   <quer:customFunction name="LOWER">
      <quer:field path="Credentials,Username"/>
   </quer:customFunction>
</quer:projection>
	</quer:projections>
	<quer:projectionFilterings/>
	<quer:filterings>
		<quer:filtering>
	<quer:notEqual>
		<quer:field path="Credentials,Username"/>
		<quer:customFunction name="LOWER">
			<quer:field path="Credentials,Username"/>
		</quer:customFunction>
	</quer:notEqual>
</quer:filtering>
	</quer:filterings>
	<quer:sortings/>
	<quer:sortingFilterings/>
	<quer:groupings/>
	<quer:joinings/>
</quer:query>