(1) Returns the left part of a character string with
the specified number of characters
هنا نختار اسم العمود وعدد الاحرف التي نريدها من كل اسم
LEFT ( character_expression , integer_expression )
# Examples :
select left(author_name,3) from ta_author
# Resulte :
ali
sal
gog
Source :
ali
saleh
gogo
------------------------------------------------------------------
(2) Returns the number of characters, instead of the number of
bytes, of the specified string expression, excluding trailing
blanks.
على نفس المثال السابق هذه الدالة تعطينا عدد أحرف محتويات كل عمود فمثلا لو كان عندنا عمود أسماء الطلاب وكان لدينا الطلاب الثلاثة السابقين في المثال السابق فإننا نحصل على عدد أحرف كل اسم طالب
select len(author_name) from ta_author
# Examples :
3
5
4
------------------------------------------------------------------
(3) Returns a character expression after it removes leading blanks
LTRIM ( character_expression )
لدمج السلاسل النصية مع بعضها
# Examples :
DECLARE @string_to_trim varchar(60) SET @string_to_trim = ' Five spaces are at the beginning of this string.' SELECT 'Here is the string without the leading spaces: ' + LTRIM(@string_to_trim)
# Resulte :
Here is the string without the leading spaces: Five spaces are at the beginning of this string
------------------------------------------------------------------
(4) Returns the integer value, as defined by the Unicode standard, for the first character of the input expression
UNICODE ( 'ncharacter_expression' )
هذه الدالة تعطي شفرة الـ ASCII للحرف الأول من الكلمة أو بمعنى أصح للحرف
# Examples :
declare @a nvarchar(50) set @a = 'srgergerg' select unicode(@a)
# Resulte:
115
------------------------------------------------------------------
(5) Returns a string of repeated spaces
SPACE ( integer_expression )
الدالة التالية تعطينا إمكانية إضافة عدد من الخانات الفارغة نقوم بتحديدها كبارامتر
# Examples :
select [last name] + ',' + space(2) + [first name] from [name]
# Resulte :
jbu, hiho
omar, ali
dodo, koko