|
التسجيل السريع مُتاح |
الإهداءات |
|
أدوات الموضوع | إبحث في الموضوع | انواع عرض الموضوع |
30-11-2011, 02:15 PM | #1 | ||
محلل نظم ( اوراكل ) تاريخ التسجيل: 5 - 10 - 2011
الدولة: الرياض
المشاركات: 30,912
معدل تقييم المستوى: 8041 |
العمل مع الوظائف في الاوراكل ( البرمجه بالاوراكل )
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 the20th century by specifying only the last two digits of the year Enables you to store 20th-century dates in the21st 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; ولنا تكمله باذن الله ---------------------------- دمتم في خير .
|
||
30-11-2011, 07:17 PM | #2 |
'، ريــــح الخُـــــزامى '،
تاريخ التسجيل: 25 - 9 - 2011
الدولة: ~ في ديـــاجِيُُـر الظـَــ ـــلـام ~
المشاركات: 5,540
معدل تقييم المستوى: 25065 |
رد: العمل مع الوظائف في الاوراكل ( البرمجه بالاوراكل )
مافي حرف مافهمته خخخخخخخخخ ،،، مشكور يالغالي بس عن جد مافهمت شي كله طلاسم بالنسبه لي ... بس اكيد في الناس اللي حتفهم عليك ... كل الشكر وتسلم ويعطيك الف عافيه .. ^^*
__________________
..؟؟.. |
30-11-2011, 11:03 PM | #3 | |
محلل نظم ( اوراكل ) تاريخ التسجيل: 5 - 10 - 2011
الدولة: الرياض
المشاركات: 30,912
معدل تقييم المستوى: 8041 |
رد: العمل مع الوظائف في الاوراكل ( البرمجه بالاوراكل )
اقتباس:
يعطيك الف عافيه ياطويله هههههههههههههه |
|
01-12-2011, 06:22 PM | #4 |
عضوة مبـــــــدعة
تاريخ التسجيل: 11 - 10 - 2009
المشاركات: 11,305
معدل تقييم المستوى: 2406 |
رد: العمل مع الوظائف في الاوراكل ( البرمجه بالاوراكل )
__________________
|
01-12-2011, 08:07 PM | #5 |
محلل نظم ( اوراكل ) تاريخ التسجيل: 5 - 10 - 2011
الدولة: الرياض
المشاركات: 30,912
معدل تقييم المستوى: 8041 |
رد: العمل مع الوظائف في الاوراكل ( البرمجه بالاوراكل )
|
12-01-2012, 09:45 AM | #6 |
ضيف جديد
تاريخ التسجيل: 12 - 1 - 2012
الدولة: اليمن
المشاركات: 10
معدل تقييم المستوى: 0 |
رد: العمل مع الوظائف في الاوراكل ( البرمجه بالاوراكل )
|
17-01-2012, 12:03 AM | #7 |
محلل نظم ( اوراكل ) تاريخ التسجيل: 5 - 10 - 2011
الدولة: الرياض
المشاركات: 30,912
معدل تقييم المستوى: 8041 |
رد: العمل مع الوظائف في الاوراكل ( البرمجه بالاوراكل )
|
18-05-2012, 08:38 PM | #8 |
محلل نظم ( اوراكل ) تاريخ التسجيل: 5 - 10 - 2011
الدولة: الرياض
المشاركات: 30,912
معدل تقييم المستوى: 8041 |
رد: العمل مع الوظائف في الاوراكل ( البرمجه بالاوراكل )
|
مواقع النشر (المفضلة) |
|
|