sql lcase()

SQL Functions

homeBack

Next

SQL LCASE()

  • The LCASE() Function

    The LCASE() function converts the value of a field to lowercase. 
    SQL LCASE() Syntax

    SELECT LCASE(column_name) FROM table_name

    Syntax for SQL Server

    SELECT LOWER(column_name) FROM table_name

  • SQL UCASE() Example

    Table Name ” emp”

    S.no Name1 Name2 City
    4857 Faran Khan Hyderabad
    2458 Peter Jhon Hyderabad
    8578 Sameer Ali Mumbai
    5874 Raj Kiran London

    Now we want to select the content of the “Name2” and “Name1” columns above, and convert the “Name1” column to lowercase.

    We use the following SELECT statement:

    SELECT LCASE(Name1) as Name1,Name2 FROM emp

    The result-set will look like this:

    Table Name ” emp”

    Name1 Name2
    faran Khan
    peter Jhon
    sameer Ali
    raj Kiran

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s