substring – mysql vs mssql

* substring – mysql vs mssql

* mysql
substring (COLNM, startindex, length)
startindex가 1부터 시작
주의: startindex에 0을 주면 결과가 empty string

SELECT substring(‘abcde’,1,3) –> abc
SELECT substring(‘abcde’,0,3) — empty

* mssql
substring (COLNM, startindex, length)
startindex가 1부터 시작
주의: startindex에 0을 주면 결과가 뒤자리에서 하나가 잘린결과 나옴
SELECT substring(‘abcde’,1,3) –> abc
SELECT substring(‘abcde’,0,3) –> ab

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