منتديات اليمن اغلى

آخر 10 مواضيع : نقل دردشاتك وبيانات حسابك في واتساب من جوالك القديم الى الجديد (الكاتـب : - )           »          غرقت في حبك (الكاتـب : - )           »          غرقت في حبك و الحياء يمنعني (الكاتـب : - )           »          أحلام الحب (الكاتـب : - )           »          علمني القلم (الكاتـب : - )           »          أحلام العشاق (الكاتـب : - )           »          أحلام العشاق (الكاتـب : - )           »          أحلام العشاق (الكاتـب : - )           »          اعترافات غرامية (الكاتـب : - )           »          اعترافات غرامية (الكاتـب : - )

العودة   منتديات اليمن أغلى YEMEN FORUMS > ::: المنتديات التكنولوجية والتعليمية ::: > •• المنتديــــات التـعليــمية > قسم لغــات البرمجـــة
حفظ البيانات؟

الإهداءات

 
 
أدوات الموضوع إبحث في الموضوع انواع عرض الموضوع
قديم 30-11-2011, 02:15 PM   #1


محلل نظم ( اوراكل )
 
الصورة الرمزية العزااني
 
تاريخ التسجيل: 5 - 10 - 2011
الدولة: الرياض
المشاركات: 30,912
معدل تقييم المستوى: 8041
العزااني has a reputation beyond repute العزااني has a reputation beyond repute العزااني has a reputation beyond repute العزااني has a reputation beyond repute العزااني has a reputation beyond repute العزااني has a reputation beyond repute العزااني has a reputation beyond repute العزااني has a reputation beyond repute العزااني has a reputation beyond repute العزااني has a reputation beyond repute العزااني has a reputation beyond repute
Oo5o.com (11) العمل مع الوظائف في الاوراكل ( البرمجه بالاوراكل )



Using Single-Row Functions to Customize Output

Objectives
After completing this lesson, you should be able to do the following:
Describe various types of functions that are available in SQL
Use character, number, and date functions in SELECT statements
Describe the use of conversion functions

------------------------------------------------------------------------------------------------
Two Types of SQL Functions
1-Single-row
functions
2- Multiple-row
functions
--------------------------------------------------------------------------------------
Single-row functions:
Manipulate data items
AAccept arguments that can be a column or an expression
ccept arguments and return one value
Act on each row that is returned
Return one result per row
May modify the data type
Can be nested

function_name [(arg1, arg2,...)]



Case-Manipulation Functions

LOWER('SQL Course')
UPPER('SQL Course')
INITCAP('SQL Course')


Using Case-Manipulation Functions

Display the employee number, name, and department number for employee Higgins:
SELECT employee_id, last_name, department_id
FROM employees
WHERE last_name = 'higgins';
no rows selected
SELECT employee_id, last_name, department_id
FROM employees
WHERE LOWER(last_name) = 'higgins';


CONCAT('Hello', 'World')

SUBSTR('HelloWorld',1,5)

LENGTH('HelloWorld)

INSTR('HelloWorld', 'W')

LPAD(salary,10,'*')

RPAD(salary, 10, '*')
REPLACE ('JACK and JUE','J','BL')
TRIM('H' FROM 'HelloWorld')


SELECT employee_id, CONCAT(first_name, last_name) NAME,
job_id, LENGTH (last_name),
INSTR(last_name, 'a') "Contains 'a'?"
FROM employees
WHERE SUBSTR(job_id, 4) = 'REP';


Number Functions

ROUND: Rounds value to specified decimal
TRUNC: Truncates value to specified decimal
MOD: Returns remainder of division

ROUND(45.926, 2)=45.93
TRUNC(45.926, 2)=45.92
MOD(1600, 300)=100


SELECT ROUND(45.923,2), ROUND(45.923,0),
ROUND(45.923,-1)
FROM DUAL;

DUAL is a dummy table that you can use to view results
from functions and calculations.

SELECT ROUND(45.923,2), ROUND(45.923),
ROUND(45.923,-1)
FROM DUAL;


For all employees with job title of Sales Representative, calculate the remainder of the salary after it is divided by 5,000.
SELECT last_name, salary, MOD(salary, 5000)
FROM employees


WHERE job_id = 'SA_REP';
The Oracle database stores dates in an internal numeric format: century, year, month, day, hours, minutes, and seconds.
The default date display format is DD-MON-RR.
Enables you to store 21st-century dates in the 20th century by specifying only the last two digits of the year
Enables you to store 20th-century dates in the 21st century in the same way


SELECT last_name, hire_date
FROM employees
WHERE hire_date < '01-FEB-88';

Working with Dates
SYSDATE is a function that returns:
Date
Time

Arithmetic with Dates

Add or subtract a number to or from a date for a resultant date value.
Subtract two dates to find the number of days between those dates.
Add hours to a date by dividing the number of hours by 24.

SELECT last_name, (SYSDATE-hire_date)/7 AS WEEKS
FROM employees
WHERE department_id = 90;

ولنا تكمله باذن الله ---------------------------- دمتم في خير .





  يمكنك المشاركة والتعليق في الموضوع بإستخدام حسابك على الفيس بوك  

العزااني غير متواجد حالياً   رد مع اقتباس
 

مواقع النشر (المفضلة)


تعليمات المشاركة
لا تستطيع إضافة مواضيع جديدة
لا تستطيع الرد على المواضيع
لا تستطيع إرفاق ملفات
لا تستطيع تعديل مشاركاتك

BB code is متاحة
كود [IMG] متاحة
كود HTML معطلة
Trackbacks are معطلة
Pingbacks are معطلة
Refbacks are متاحة

الانتقال السريع


الساعة الآن 03:41 PM

عقارات اليمن


Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd. TranZ By Almuhajir
جميع الحقوق محفوظة لمنتديات اليمن أغلى