SQL

Wednesday, May 24, 2017

How to get first character of a string in SQL?

LEFT(colName, 1) will also do this, also. It's equivalent to SUBSTRING(colName, 1, 1).
I like LEFT, since I find it a bit cleaner, but really, there's no difference either way.
Posted by Tecknovice at 3:59 AM
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

About Me

Tecknovice
View my complete profile

Blog Archive

  • ►  2021 (1)
    • ►  January (1)
  • ►  2020 (3)
    • ►  December (3)
  • ▼  2017 (28)
    • ►  August (2)
    • ▼  May (24)
      • MySQL WEEK() function
      • SQL Select only rows with Max Value on a Column
      • Useful SQL websites
      • Self JOIN
      • Visual Representation of SQL Joins (CodeProject)
      • SELECT from nothing?
      • HAVING
      • ORDER BY
      • DISTINCT
      • Aggregate Functions
      • GROUP BY
      • select the extreme from each group
      • How to declare a variable in MySQL?
      • SQL COUNT(), AVG() and SUM() Functions
      • How to get first character of a string in SQL?
      • converts the value of a field to uppercase.
      • converts the value of a field to lowercase.
      • SQL CONCATENATE (appending strings to one another)...
      • MySQL
      • Hướng dẫn cài đặt và cấu hình MySQL Community
      • + (String Concatenation) (Transact-SQL)
      • SQL NULL Functions
      • UNION
      • Get the length of the value in a text field.
    • ►  April (2)
  • ►  2016 (8)
    • ►  December (6)
    • ►  November (2)
Simple theme. Powered by Blogger.