Home
Search results “Oracle trunc to year”
oracle date and time functions
 
21:33
Video from our Oracle SQL course. Check out the full course at.. http://learn.hackpress.co/courses/oracle-sql-learning-by-example
Views: 46445 etldeveloper
SQL 36, trunc function
 
02:36
What you can do with trunc function in SQL
Views: 4145 hammadshams
Oracle || Date functions Part-1 by dinesh
 
17:06
DURGASOFT is INDIA's No.1 Software Training Center offers online training on various technologies like JAVA, .NET , ANDROID,HADOOP,TESTING TOOLS ,ADF,INFORMATICA,TABLEAU,IPHONE,OBIEE,ANJULAR JS, SAP... courses from Hyderabad & Bangalore -India with Real Time Experts. Mail us your requirements to [email protected] so that our Supporting Team will arrange Demo Sessions. Ph:Call +91-8885252627,+91-7207212428,+91-7207212427,+91-8096969696. http://durgasoft.com http://durgasoftonlinetraining.com https://www.facebook.com/durgasoftware http://durgajobs.com https://www.facebook.com/durgajobsinfo......
Oracle TO_DATE Function Explained with Examples
 
06:14
https://www.databasestar.com/oracle-to_date/ The Oracle TO_DATE function is one of the most useful conversion functions in Oracle. It can be a little confusing though. The TO_DATE function is used to convert a character value to a date value. You can use it to convert a string that is in the format of a date, into a date data type. Why would you use this? Converting a character to a date is helpful if you want to insert a date into a column in a table. Being specific about the format (explicit) is better than assuming the conversion will be done for you (implicit). This TO_DATE function only converts to a DATE data type. If you want to convert to the other datetime data types, you’ll have to use other functions such as TO_TIMESTAMP or TO_TIMESTAMP_TZ. The syntax for this function is: TO_DATE(charvalue [, format_mask [, nls_date_language]]) The parameters for this function are: Charvalue: This is the character value that you want to convert to a date. It’s the main input of the function. Format_mask: This is the format that the input value, the charvalue, is in. This is used to help convert your character value into a date, as your character may be in a different format to the default. Nls_date_language: this is used to determine how the output is displayed. For more information about the Oracle TO_DATE function, including all of the SQL shown in this video and the examples, read the related article here: https://www.databasestar.com/oracle-to_date/
Views: 1783 Database Star
ORACLE SQL Tutorial to get Years of Experience
 
17:26
In this video, we will see how add_months, months_between can be used to get Years of work experience for an employee. SQL used in this video are given below. select add_months(sysdate,2) from dual; select months_between(sysdate,to_date('22082016','ddmmyyyy') ) from dual; select trunc(months_between(sysdate,to_date('22082016','ddmmyyyy') )) from dual; select mod(16,12) from dual; select * from employees; SELECT first_name,hire_date, trunc(months_between(SYSDATE,hire_date)) mnths_between from employees; 12 months = 1 year SELECT first_name,hire_date, trunc(months_between(SYSDATE,hire_date)) mnths_between, trunc(months_between(SYSDATE,hire_date)/12) years, trunc(months_between(SYSDATE,hire_date)) - trunc(months_between(SYSDATE,hire_date)/12)*12 No_of_Months from employees; SELECT hire_date,add_months(hire_date,trunc(months_between(SYSDATE,hire_date))) new_date from employees; SELECT hire_date, trunc(sysdate) - add_months(hire_date,trunc(months_between(SYSDATE,hire_date))) no_of_days from employees; SELECT first_name,hire_date, trunc(months_between(SYSDATE,hire_date)) mnths_between, trunc(months_between(SYSDATE,hire_date)/12) years, trunc(months_between(SYSDATE,hire_date)) - trunc(months_between(SYSDATE,hire_date)/12)*12 No_of_Months, trunc(sysdate) - add_months(hire_date,trunc(months_between(SYSDATE,hire_date))) no_of_days from employees;
Views: 55 Ganesh Anbarasu
Oracle TO_TIMESTAMP Function
 
01:31
https://www.databasestar.com/oracle-to_timestamp/ The Oracle TO_TIMESTAMP function can be confusing, but we’ll explain it in this video. This function allows you to convert a string value into a TIMESTAMP value. A TIMESTAMP value is a type of DATE, but has a few components: - A date, including day, month, and year - A time, including hours, minutes, seconds, and fractional seconds This is a useful data type because it allows you to store a time down to fractions of a second. The syntax of the TO_TIMESTAMP function is: TO_TIMESTAMP ( input_string [, format_mask] [, nls_param] ) The input_string parameter is the string you want to convert. The format_mask is where you specify the format of the input_string parameter. This is so you can specify the input_string in a variety of formats, and just use this format_mask to indicate which format it is in. The nls_param parameter is another optional parameter, and allows you to specify the returning language of the month and day names. The default format will depend on the region you’re running your database in. In my example (using Oracle Express in Australia), the default format is ‘DD-MM-RRRR HH:MI:SS AM’. For more information on the Oracle TO_TIMESTAMP function, including the SQL used in this video, read the related article here: https://www.databasestar.com/oracle-to_timestamp/
Views: 467 Database Star
Oracle TO_NUMBER Function
 
02:42
https://www.databasestar.com/oracle-to_number/ The Oracle TO_NUMBER function is used to convert a text value into a number value. It’s similar to TO_CHAR and TO_DATE, but converts a value to a number. The number will also be rounded to a specified number of digits, and returned as a NUMBER value. The syntax is: TO_NUMBER( input_value, [format_mask], [nls_parameter] ) The input_value is the value to be converted to a number. Commonly this is provided as a string (e.g. CHAR or VARCAHR2) but can be several other data types as well. The format_mask is the format that the output value should be displayed as. It must be a valid number format. This is an optional value. The final parameter, nls_date_language, is used to work out how the output is displayed, such as how to display currency symbols. It’s also an optional value. For more information about the Oracle TO_NUMBER function, including all of the SQL shown in this video and the examples, read the related article here: https://www.databasestar.com/oracle-to_number/
Views: 2456 Database Star
Oracle CURRENT_TIMESTAMP Function
 
02:37
https://www.databasestar.com/oracle-date-functions/ The Oracle CURRENT_TIMESTAMP function will display the current date and time in the session time zone. Just like the CURRENT_DATE function, it uses the session time zone, which is where you logged in from. This could be different to the database time zone. The syntax of the CURRENT_TIMESTAMP function is: CURRENT_TIMESTAMP ( [precision] ) The return type of this function is TIMESTAMP WITH TIME ZONE. The precision parameter is optional, and it lets you specify the number of fractional seconds to return. If this is omitted, it uses the default of 6. It’s different to the SYSTIMESTAMP function, because CURRENT_TIMESTAMP returns the session timezone, and SYSTIMESTAMP returns the database time zone. So, if I’m logging in from Melbourne, Australia, and the database is in London, England, then the CURRENT_TIMESTAMP will return a date and time that’s 10 hours ahead of SYSTIMESTAMP, and in a different time zone. It may be on the same day, or it could be a different day, depending on when I run the function. You can perform arithmetic on this function just like any other date value (e.g. CURRENT_TIMESTAMP - 7 for 7 days ago). However, it might be better to use interval data types so you can keep the original data type. For more information about the Oracle CURRENT_TIMESTAMP function, including all of the SQL shown in this video and the examples, read the related article here: https://www.databasestar.com/oracle-date-functions/
Views: 319 Database Star
Oracle Tutorial - Date Functions NEXT_DAY | LAST_DAY
 
07:13
Oracle Tutorials - Date Functions NEXT_DAY( ) | LAST_DAY( )
Views: 132 Tech Acad
Oracle MONTHS_BETWEEN Function
 
02:17
https://www.databasestar.com/oracle-months_between/ The Oracle MONTHS_BETWEEN function allows you to find the number of months between two dates. You can enter two dates and the function returns the difference. This function is often used as part of other calculations. Sometimes you’ll want to know the difference between two dates to perform other functions. The syntax of the MONTHS_BETWEEN function is: MONTHS_BETWEEN(date1, date2) What do these two parameters mean? The function performs date1 minus date2. So, if date1 is larger, the result is positive. If date2 is larger, then the result is negative. What data type is returned? It depends on the values you provide. If the dates are both on the same day of the month (e.g. both on the 10th of the month), then the result is an integer or whole number. If not, then the result will be a decimal value. For more information on the MONTHS_BETWEEN function, including the code used in this video and examples, read the related article here: https://www.databasestar.com/oracle-months_between/
Views: 1017 Database Star
ORACLE: How to get FIRST and LAST DAY of  Month ?
 
00:56
SQL Language, available for any version of Oracle Database.
Views: 5453 1Click2beDBA
Função Oracle LAST DAY
 
03:51
Acesse o desafio: http://novidades.aprendaplsql.com/15-dias-de-funcoes-oracle A função LAST_DAY retorna o último dia do mês da data passada como parâmetro. SELECT trunc(sysdate) AS Data_atual, last_day(trunc(sysdate)) AS ultimo_dia_mes FROM dual; SELECT last_day(to_date('10/02/2016', 'DD/MM/YY')) AS ultimo_dia_mes FROM dual; SELECT hire_date, last_day(hire_date) AS Ultimo_dia_mes FROM hr.employees WHERE employee_id =114; https://www.youtube.com/playlist?list=PLMaqczuL07LkjrX6Rvx6TdNM-1nbUKG8p
Views: 550 Aprenda PL/SQL
Oracle Tutorial Date Function - 2
 
07:10
Oracle Date Function, Order by Month Year. Getting employee count hired month, yearwise and order by hiring month and year. SQL Used in the video below. select * from employees order by hire_date; select hire_date,to_char(hire_date,'Month,YYYY') from employees; select to_char(hire_date,'Month,YYYY')Month_Year,count(*) No_Of_Employees from employees group by to_char(hire_date,'Month,YYYY') order by to_char(hire_date,'Month,YYYY') select to_char(hire_date,'Month,YYYY')Month_Year,count(*) No_Of_Employees from employees group by to_char(hire_date,'Month,YYYY') order by to_date(to_char(hire_date,'Month,YYYY'),'Month,YYYY') select replace(to_char(hire_date,'Month,YYYY'),' ','')Month_Year,count(*) No_Of_Employees from employees group by to_char(hire_date,'Month,YYYY') order by to_date(to_char(hire_date,'Month,YYYY'),'Month,YYYY')
Views: 84 Ganesh Anbarasu
TOP 25 SQL Interview Questions 2017
 
03:36
TOP 25 SQL Interview Questions
Views: 714 SQL Guru
Função Oracle ADD MONTHS
 
05:29
Acesse o desafio: http://novidades.aprendaplsql.com/15-dias-de-funcoes-oracle A função ADD_MONTHS no Oracle recebe 2 parâmetros, sendo o primeiro a data que vai ser manipula e o segundo um inteiro que pode ser positivo ou negativo referente a quantidade de meses que serão adicionados ou subtraídos. SELECT trunc(sysdate) AS Data_atual, add_months(trunc(sysdate), 5) AS ADD_MONTHS FROM dual; SELECT add_months(to_date('29/02/16', 'DD/MM/YY'),1) AS ADD_MONTHS FROM dual; SELECT add_months(to_date('28/02/17', 'DD/MM/YY'),1) AS ADD_MONTHS FROM dual; SELECT add_months(to_date('27/02/16', 'DD/MM/YY'),1) AS ADD_MONTHS FROM dual; SELECT trunc(sysdate) AS Data_atual, add_months(trunc(sysdate), -1) AS ADD_MONTHS FROM dual; https://www.youtube.com/playlist?list=PLMaqczuL07LkjrX6Rvx6TdNM-1nbUKG8p
Views: 532 Aprenda PL/SQL
Oracle SQL TUTORIAL – Date columns with Time in Where condition
 
12:41
In this video, we will see how to retrieve records for a specific time duration. SQLs used in this video are given below. select * from employees; alter session set nls_date_format = 'DD-MON-YYYY HH24:MI:SS'; SELECT DBMS_RANDOM.VALUE(0,9) FROM DUAL; SELECT SYSDATE-DBMS_RANDOM.VALUE(0,9) FROM DUAL; SELECT FIRST_NAME,LAST_NAME, SYSDATE-DBMS_RANDOM.VALUE(0,9) CREATED_DATE FROM EMPLOYEES; CREATE TABLE EMP_TEST AS SELECT FIRST_NAME,LAST_NAME, SYSDATE-DBMS_RANDOM.VALUE(0,9) CREATED_DATE FROM EMPLOYEES; SELECT * FROM EMP_TEST ORDER BY CREATED_DATE DESC; select sysdate from dual; select sysdate,trunc(sysdate) from dual; 26 sep 2018 00:00:00 to 26 sep 2018 23:59:59 select sysdate,trunc(sysdate),trunc(sysdate)+0.99999 from dual; Records that got created yesterday.. 25 sep 2018 00:00:00 to 25 sep 2018 23:59:59 select trunc(sysdate-1),trunc(sysdate-1)+0.99999 from dual; SELECT * FROM emp_test WHERE created_date BETWEEN trunc(SYSDATE-1) AND trunc(SYSDATE-1)+0.99999 order by created_date; Retrieve records for 22nd Septembter 2018 SELECT * FROM emp_test WHERE created_date BETWEEN to_date('22-sep-2018 00:00:00','dd-mon-yyyy hh24:mi:ss') AND to_date('22-sep-2018 23:59:59','dd-mon-yyyy hh24:mi:ss') order by created_date; SELECT * FROM emp_test WHERE created_date BETWEEN to_date('22-sep-2018','dd-mon-yyyy') AND to_date('22-sep-2018 23:59:59','dd-mon-yyyy hh24:mi:ss') order by created_date; -- Get all records created in last 24 hours select sysdate,sysdate-1 from dual; SELECT * FROM emp_test where created_date between sysdate-1 and sysdate order by created_date;
Views: 137 Ganesh Anbarasu
Date Functions (Introduction to Oracle SQL)
 
05:48
Learn what date functions are and see some examples of them. The full Introduction to Oracle SQL course is available here: https://www.databasestar.com/introduction-to-oracle-sql-course/
Views: 332 Database Star
Oracle SUBSTR and INSTR example
 
06:00
In this video, we will see how to use Oracle SUBSTR and INSTR functions in a nested manner.
Views: 2624 Ganesh Anbarasu
SQL To_char Function with excellent examples
 
13:27
SQL To_char Function with excellent examples
Views: 7758 SQL Guru
ADD_MONTHS Function in SQL Query with Example
 
02:32
ADD_MONTHS(): The Oracle/PLSQL ADD_MONTHS function returns a date plus n months. Syntax: ADD_MONTHS( date1, n ) Arguments: date1 is the starting date (before the n months have been added). n is the number of months to add to date1. Example: Let's look at some Oracle ADD_MONTHS function examples and explore how you would use the ADD_MONTHS function in Oracle/PLSQL. ADD_MONTHS('01-Aug-03', 3) would return '01-Nov-03' ADD_MONTHS('01-Aug-03', -3) would return '01-May-03' ADD_MONTHS('21-Aug-03', -3) would return '21-May-03' ADD_MONTHS('31-Jan-03', 1) would return '28-Feb-03' Thanks for watching..:)
Views: 1146 WingsOfTechnology
Learn Oracle | How to use the Character Functions, Date Functions in SQL
 
14:53
Pebbles present, Learn Oracle 10g with Step By Step Video Tutorials. Learn Oracle 10g Tutorial series contains the following videos : Learn Oracle - History of Oracle Learn Oracle - What is Oracle - Why do we need Oracle Learn Oracle - What is a Database Learn Oracle - What is Grid Computing Learn Oracle - What is Normalization Learn Oracle - What is ORDBMS Learn Oracle - What is RDBMS Learn Oracle - Alias Names, Concatenation, Distinct Keyword Learn Oracle - Controlling and Managing User Access (Data Control Language) Learn Oracle - Introduction to SQL Learn Oracle - Oracle 10g New Data Types Learn Oracle - How to Alter a Table using SQL Learn Oracle - How to Create a Package in PL SQL Learn Oracle - How to Create a Report in SQL Plus Learn Oracle - How to Create a Table using SQL - Not Null, Unique Key, Primary Key Learn Oracle - How to Create a Table using SQL Learn Oracle - How to Create a Trigger in PL SQL Learn Oracle - How to Delete Data from a Table using SQL Learn Oracle - How to Drop and Truncate a Table using SQL Learn Oracle - How to Insert Data in a Table using SQL Learn Oracle - How to open ISQL Plus for the first time Learn Oracle - How to Open SQL Plus for the First Time Learn Oracle - How to Update a Table using SQL Learn Oracle - How to use Aggregate Functions in SQL Learn Oracle - How to use Functions in PL SQL Learn Oracle - How to use Group By, Having Clause in SQL Learn Oracle - How to Use Joins, Cross Join, Cartesian Product in SQL Learn Oracle - How to use Outer Joins (Left, Right, Full) in SQL Learn Oracle - How to use the Character Functions, Date Functions in SQL Learn Oracle - How to use the Merge Statement in SQL Learn Oracle - How to use the ORDER BY Clause with the Select Statement Learn Oracle - How to use the SELECT Statement Learn Oracle - How to use the Transactional Control Statements in SQL Learn Oracle - How to use PL SQL Learn Oracle - Data Types in PL SQL Learn Oracle - Exception Handling in PL SQL Learn Oracle - PL SQL Conditional Logics Learn Oracle - PL SQL Cursor Types - Explicit Cursor, Implicit Cursor Learn Oracle - PL SQL Loops Learn Oracle - Procedure Creation in PL SQL Learn Oracle - Select Statement with WHERE Cause Learn Oracle - SQL Operators and their Precedence Learn Oracle - Using Case Function, Decode Function in SQL Learn Oracle - Using Logical Operators in the WHERE Clause of the Select Statement Learn Oracle - Using Rollup Function, Cube Function Learn Oracle - Using Set Operators in SQL Learn Oracle - What are the Different SQL Data Types Learn Oracle - What are the different types of Databases Visit Pebbles Official Website - http://www.pebbles.in Subscribe to our Channel – https://www.youtube.com/channel/UCNNjWVsQqaMYccY044vtHJw?sub_confirmation=1 Engage with us on Facebook at https://www.facebook.com/PebblesChennai Please Like, Share, Comment & Subscribe
Views: 2466 Pebbles Tutorials
Oracle SQL: Exploring Date Functions
 
07:29
http://www.informit.com/store/oracle-sql-livelessons-video-training-downloadable-9780134275741?WT.mc_id=Social_YT Oracle SQL: Exploring Date Functions is an excerpt from Oracle SQL LiveLessons Video Training -- 6+ Hours of Video -- Oracle SQL LiveLessons Video Training covers the basics of the Oracle SQL programming language. This course covers both Oracle standard SQL and the ANSI approved SQL that Oracle supports. The focus of the course is to give students working knowledge of the Oracle SQL language and at the conclusion of this course, students should be able to query the Oracle database. Description In this LiveLessons video course, Oracle ACE Director Dan Hotka will teach you how to use the SQL query language, interpret business questions into SQL code, and how to use Where clauses sub-queries, complex table join conditions, and how to create table objects and populate tables with data. Students will also learn how to access Oracle from Microsoft products such as Excel. In addition, they will learn how analytical SQL can be used for business analysis. This course will use both Toad and SQL Developer for SQL examples. About the Instructor Dan Hotka is a training specialist and an Oracle ACE director who has more than 37 years in the computer industry and more than 31 years of experience with Oracle products. His experience with the Oracle RDBMS dates back to the Oracle V4.0 days. Dan enjoys sharing his knowledge of the Oracle RDBMS. Dan is well published with 12 Oracle books and well over 200 published articles. He is also the video author for Oracle SQL Performance Tuning for Developers LiveLessons and Oracle PL/SQL Programming Fundamentals. He is frequently published in Oracle trade journals, regularly blogs, and speaks at Oracle conferences and user groups around the world. Visit his website at www.DanHotka.com. Skill Level Beginner Learn How To Use the SQL query language Interpret business questions into SQL code Understand Oracle standard SQL and ANSI SQL Work with Where clauses, sub-queries, and complex table join conditions Create table objects and populate these tables with data Access Oracle from Microsoft products such as Excel Use analytical SQL, useful for business analysts Who Should Take This Course Students who are new to SQL and want to learn Oracle SQL Course Requirements Basic knowledge of what is a database, especially RDBMS and what is a computer programming language http://www.informit.com/store/oracle-sql-livelessons-video-training-downloadable-9780134275741?WT.mc_id=Social_YT
Views: 5181 LiveLessons
Using the AVG function (Introduction to Oracle SQL)
 
02:59
Find the average of values using the AVG function. The full Introduction to Oracle SQL course is available here: https://www.databasestar.com/introduction-to-oracle-sql-course/
Views: 210 Database Star
SQL 38, Extract Function be42.flv
 
01:16
SQL extract example
Views: 860 hammadshams
SQL Tutorial - 45: Date & Time Functions (Part-1)
 
05:15
In this tutorial we'll see how we can add dates, subtract dates, view current date and current time using ADDDATE(), SUBDATE(), CURDATE() and CURTIME Functions respectively.
Views: 36125 The Bad Tutorials
Oracle DV - Use TimestampDiff to Calculate Interval Between Two Dates
 
01:46
This video shows simple way to leveage TimestampDiff function in Oracle DV to calculate time interval between two dates. Download the latest version of DV today https://www.oracle.com/technetwork/middleware/oracle-data-visualization/downloads/oracle-data-visualization-desktop-2938957.html.
Views: 289 Oracle Analytics
trunc(sysdate-1)
 
03:49
Views: 158 matthew naquin
Função Oracle MONTHS BETWEEN
 
04:54
Acesse o desafio: http://novidades.aprendaplsql.com/15-dias-de-funcoes-oracle A função de MONTHS_BETWEEN retorna a diferença de meses entre duas datas. SELECT months_between(TO_DATE('28/12/2017', 'DD/MM/YY'), TO_DATE('03/08/2017', 'DD/MM/YY')) AS MONTHS_BETWEEN FROM dual; SELECT trunc(months_between(TO_DATE('28/12/2017', 'DD/MM/YY'), TO_DATE('03/08/2017', 'DD/MM/YY'))) AS MONTHS_BETWEEN FROM dual; SELECT round(months_between(TO_DATE('28/12/2017', 'DD/MM/YY'), TO_DATE('03/08/2017', 'DD/MM/YY'))) AS MONTHS_BETWEEN FROM dual; https://www.youtube.com/watch?v=PjaBYIwXf8c&list=PLMaqczuL07LkjrX6Rvx6TdNM-1nbUKG8p
Views: 672 Aprenda PL/SQL
Oracle SQL Video Tutorial 19 - DATE functions
 
06:54
Oracle SQL Video Tutorials 19 - DATE functions explained
Views: 4317 Just Channel
คำสั่ง TRUNC ตัดค่าวันที่กับตัวเลขแบบง่าย ๆ ใน Oracle
 
08:10
คำสั่ง TRUNC ตัดค่าวันที่กับตัวเลขแบบง่าย ๆ ใน Oracle ดูเพิ่มเติมได้ที่ http://www.doesystem.info/2016/07/oracle-trunc.html โปรแกรม สอนใช้โปรแกรม สอน แนะนำ และช่วยแก้ปัญหา เกี่ยวกับคอมพิวเตอร์และไอที สอนการใช้งาน การเรียนรู้ การแก้ปัญหา การทำเว็บไซต์ การเขียนโปรแกรม และไอทีอื่น ๆ Oracle คำสั่ง TRUNC เบื้องต้น บทความนี้เรามาดูคำสั่งใน Oracle กันอีกซักหน่อย ซึ่งคำสั่งนั้นคือ TRUNC ครับ ในคำสั่ง TRUNC นั้นสามารถใช้ได้ทั้งตัวเลขและก็เวลาเลยครับ นั่นก็แปลว่ามันจะมีทั้งคำสั่ง TRUNC(date) และก็ TRUNC(number) มาดู Syntax กันก่อนดีกว่าครับ TRUNC(number) Syntax ของ TRUNC(number) แสดงได้ดังด้านล่าง TRUNC(n1 [, n2 ]) TRUNC(number) เมื่อเรียกใช้จะรีเทิร์นค่าเป็นตัวเลขที่ถูกตัดออก ตัวตำแหน่งของตัวที่ถูกตัดออกจะถูกกำหนดด้วย n2 แต่ถ้าไม่ได้กำหนด n2 มาให้ n2 จะถูกแทนที่ด้วยเลข 0 ในฟังก์ชัน TRUNC(number) นี้เราสามารถกำหนดได้ทั้งจำนวนลบ บวก หรือ 0 ก็ได้ทั้งนั้น เรามาดูตัวอย่างการใช้งานกัน ตัวอย่างคำสั่ง TRUNC(number) แบบง่าย ๆ select trunc(19.32, 0) from dual; ผลลัพธ์ที่ได้ก็คือ 19 เพราะตัดตำแหน่งที่ 0 select trunc(19.32, 1) from dual; ผลลัพธ์ที่ได้คือ 19.3 เพราะตัดตำแหน่งที่ 1 select trunc(19.32, -1) from dual; ผลลัพธ์ที่ได้คือ 10 เพราะตัดตำแหน่งที่ -1 นั่นคือย้อนกลับไปหนึ่งตำแหน่งก็คือ 10 เลข 9 ตัดทิ้ง TRUNC(date) Syntax ของ TRUNC(date) แสดงได้ดังด้านล่าง TRUNC(date [, fmt ]) TRUNC(date) เมื่อเรียกใช้ฟังก์ชันนี้แล้วจะรีเทิร์นค่าเป็น Date ซึ่ง Date ที่ได้จะเป็นเวลาที่ถูกตัดโดยกำหนดไว้ใน fmt ข้อมูลที่ได้จะเป็นข้อมูล Date เสมอแม้ว่าจะกำหนดตัวแปรเป็น DateTime ก็ตามแต่ สำหรับ fmt ที่ใส่ได้นั้นแสดงได้ตามด้านล่าง Unit Valid format parameters Year SYYYY, YYYY, YEAR, SYEAR, YYY, YY, Y ISO Year IYYY, IY, I Quarter Q Month MONTH, MON, MM, RM Week WW IW IW W W Day DDD, DD, J Start day of the week DAY, DY, D Hour HH, HH12, HH24 Minute MI เมื่อได้ format แล้วเรามาลองเรียกใช้งานกันดูครับ ตัวอย่างง่าย ๆ สำหรับการใช้งานฟังก์ชัน TRUNC ใน Oracle แสดงได้ดังนี้ select trunc(to_date('04-07-2016', 'DD-MM-YYYY'), 'YEAR') from dual; เมื่อรันคำสั่งนี้จะได้ผลลัพธ์เป็น 01-JAN-16 ซึ่งเราใช้ฟอร์แมท YEAR เป็นฟอร์แมทของปีดังนั้นมันจะตัดทิ้งแล้วไปต้นปีนั่นก็คือวันที่ 1 มกราของปีนั้น ๆ คือ 1 JAN 2016 select trunc(to_date('04-07-2016', 'DD-MM-YYYY'), 'MONTH') from dual; ตัวอย่างนี้เมื่อรันแล้วจะได้ผลลัพธ์เป็น 01-JUL-16 ซึ่งก็ได้ว่าฟอร์แมทที่เราใช้นั้นเป็น MONTH ซึ่งเป็นเดือน ดังนั้นมันจะกระโดดไปต้นเดือนแล้วตัดส่วนอื่นทิ้งนั่นก็คือต้นเดือนวันที่ 1 JUL 2016 สำหรับฟอร์แมทอื่น ๆ หรือตัวเลขอื่น ๆ ของไปเล่นกันดูครับ
Views: 415 Akira Shoyasu
ROUND and TRUNCATE Functions with Dates: SQL Tutorial 38
 
00:28
Please watch: "Install Oracle Database 12c Release 2 on Windows 10 Professional 64 bit" https://www.youtube.com/watch?v=5705VFJmku0 -~-~~-~~~-~~-~-
Views: 308 Solution Wizard
SQL 37 -How to calculate age Part 1
 
05:05
Structured Query Languge
Views: 7169 hammadshams
How To Use Number function in SQL SELECT Statement - MySql Database Bangla Tutorial Part 17
 
05:35
In this turial, I will show you How To use round function in SQL SELECT Statement, To use mod function in SQL SELECT Statement, To use truncate function in SQL SELECT Statement, . I hope you enjoy this tutorial. Please subscribe my channel. number function in mysql - round function in mysql - roundup in mysql - round down in mysql - truncate command in mysql - truncate function in mysql - truncate string in mysql - truncate table in mysql - mod function in mysql - mode function in mysql - mode in mysql - mysql functions- mysql tutorial in bangla - mysql bangla tutorial - mysql - tutorial - beginner - advanced - mysql tutorial.
Views: 179 Soft-All
Use of TRUNC Function for separating Date and Time in Excel sheet
 
01:59
excel function TRUNC various usages........
Views: 130 Er.Sathavara Dinesh
SQL ROUND function - how to use SQL ROUND function
 
02:40
The SQL Server ROUND function returns a number rounded to a certain number of decimal places. visit Dose for excel Add-In website: http://www.zbrainsoft.com/ Visit our channel: https://www.youtube.com/channel/UCI4bMWYzrBTs47KINXL92Kw
AskTom TV - densification of data in date ranges
 
05:16
A video to help you understand the "thought process" behind answering AskTom questions. In this episode, we look at how to fill in the blanks with a range of dates. Original question: https://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:9536337800346137139 blog: https://connor-mcdonald.com ========================================­­­­============== Copyright © 2017 Oracle and/or its affiliates. Oracle is a registered trademark of Oracle and/or its affiliates. All rights reserved. Other names may be registered trademarks of their respective owners. Oracle disclaims any warranties or representations as to the accuracy or completeness of this recording, demonstration, and/or written materials (the “Materials”). The Materials are provided “as is” without any warranty of any kind, either express or implied, including without limitation warranties or merchantability, fitness for a particular purpose, and non-infringement.
Views: 514 Connor McDonald
Tutorial#40 NVL Function in  oracle SQL with example
 
06:45
Explaining NVL SQL NULL function / Oracle Function NVL Function, It Replaces Null Values With some Values or string. or how to use NULL Values in Oracle SQL or what is NVL Function explain with the example or nvl function in SQL Assignment link : https://drive.google.com/open?id=1lR8CDiCt7vdV1EogFtKc654fAeCGBgdK In this series we cover the following topics: SQL basics, create table oracle, SQL functions, SQL queries, SQL server, SQL developer installation, Oracle database installation, SQL Statement, OCA, Data Types, Types of data types, SQL Logical Operator, SQL Function,Join- Inner Join, Outer join, right outer join, left outer join, full outer join, self-join, cross join, View, SubQuery, Set Operator. Link for assignment: UPPERfunction in SQL https://drive.google.com/open?id=1ibjDTDX-CiPUShpf8j9kLkLjkYRdN9_e follow me on: Facebook Page: https://www.facebook.com/LrnWthr-319371861902642/?ref=bookmarks Contacts Email: [email protected] Instagram: https://www.instagram.com/equalconnect/ Twitter: https://twitter.com/LrnWthR #NVLFunctionInOracle #OracleSQLTutorial #SQLCourseForBeginner
Views: 81 EqualConnect Coach
SYSDATE Function: SQL Tutorial 35
 
00:26
Please watch: "Install Oracle Database 12c Release 2 on Windows 10 Professional 64 bit" https://www.youtube.com/watch?v=5705VFJmku0 -~-~~-~~~-~~-~-
Views: 364 Solution Wizard
Extract Oracle data
 
01:39
Extract Oracle data with customized tasks
Views: 207 TLIUpdates
Oracle SQL Data Conversion-Implicit Explicit
 
19:23
Oracle SQL Data Conversion Implicit Explicit Online console used -- https://livesql.oracle.com Implicit and Explicit data conversion to_char, to_number, to_date and cast functions Queries: /*IMPLICIT DATA CONVERSION EXAMPLES*/ SELECT salary + '10' FROM hr.employees; SELECT last_name FROM hr.employees WHERE employee_id = '200'; SELECT last_name FROM hr.employees WHERE employee_id = 200; SELECT last_name FROM hr.employees WHERE hire_date = '03-MAR-97'; Create table birth(name varchar2(15), dob date); Insert into birth values ('nids', '12/jan/58'); Insert into birth values ('panda', '14/feb/48'); Insert into birth values ('Spider', '14/feb/1958'); Insert into birth values ('agnes', '14/feb/2048'); Select * from birth; SELECT to_date('12-jan-58') - to_date('14-feb-48') from DUAL; '01/01/2058','MM/DD/RRRR' 01/01/2058 '01/01/2048','MM/DD/RRRR' 01/01/2048 '01/01/48','MM/DD/RRRR' 01/01/2048 '01/01/58','MM/DD/RRRR' 1/01/1958 '01/01/48','MM/DD/YYYY' 01/01/0048 '01/01/58','MM/DD/YYYY' 01/01/0058 '01/01/58','MM/DD/YY' 01/01/2058 '01/01/48','MM/DD/YY' 01/01/2048 SELECT * FROM NLS_SESSION_PARAMETERS WHERE PARAMETER = 'NLS_DATE_FORMAT'; Alter session set nls_date_format = 'DD-MM-RRRR'; Select * from birth; alter session set nls_date_format = 'DD-MON-YYYY'; Select * from birth; ALTER session set nls_date_format = 'DD-MON-YY'; SELECT to_date('12-jan-58') - to_date('14-feb-48') from DUAL; ALTER session set nls_date_format = 'DD-MON-RR'; /*EXPLICIT DATA CONVERSION EXAMPLES*/ /*TO_CHAR, TO_DATE, TO_NUMBER*/ SELECT first_name, TO_CHAR (hire_date, 'MON DD, YYYY') HIRE_DATE, TO_CHAR (salary, '$99999.99') Salary FROM hr.employees; SELECT TO_CHAR('01110') FROM DUAL; SELECT TO_CHAR('01110' + 1) FROM DUAL; SELECT TO_DATE('2012-06-05', 'YYYY-MM-DD') FROM dual; SELECT TO_DATE( '5 Jan 2017', 'DD MON YYYY' ) FROM dual; SELECT TO_NUMBER('1210.73', '9999.99') from DUAL; SELECT TO_NUMBER('$65.169', 'L99.999') FROM DUAL; SELECT TO_NUMBER('123,456,789', '999,999,999') FROM DUAL; /*This example takes a complicated string, determines that it is in certain format, and specifies the numeric characters to use*/ SELECT TO_NUMBER('$17 218,00', 'L999G999D00',' NLS_NUMERIC_CHARACTERS='', ''') FROM DUAL; /*CAST*/ SELECT CAST( '22-Aug-2003' AS varchar2(30) ) from dual; SELECT CAST('245.205' AS NUMBER(5,2)) FROM dual; /*      -- Result: 245.21 (note that the value is rounded, not truncated to 245.20) */ SELECT CAST(245.205 AS NUMBER(5,2)) FROM dual; SELECT CAST ('123456' AS NUMBER) + 5 FROM DUAL; SELECT CAST ('5.05.2017' AS DATE) +5 FROM DUAL; /*check the default date format. That's why it give error*/ SELECT CAST ('30-APRIL-2015' AS DATE) +5 FROM DUAL; SELECT CAST (SYSDATE AS TIMESTAMP) FROM DUAL; SELECT SYSDATE FROM DUAL;
Views: 78 Nids Dixit
SQL Tutorial - 46: Date & Time Functions (Part-2)
 
05:36
In this tutorial we'll understand how we can view the day name for a particular date, view the current date and time through a single function and also to make dates with year and day values through the DAYNAME(), NOW() and MAKEDATE() functions respectively. Thanks for watching!
Views: 20682 The Bad Tutorials
Learn Excel - Truncate Date+Time to Date - Podcast 2203
 
03:49
Ian in Nashville gets data from the system. The date column has date and time. This really screws up the pivot table, because instead of daily dates, he gets time. One solution: Group the pivot table by Date Better solution: Power Query Make the downloaded data set in to a table with Ctrl+T Data, From Table. Select the Date Time column and transform to Date Close and Load Build the pivot table from that The next time you get data, paste to original table. Go to Query. Refresh. Refresh the Pivot Table To download this workbook: https://www.mrexcel.com/download-center/2018/05/date-time-to-date.xlsx List of upcoming seminars: https://www.mrexcel.com/press-appearances/
Views: 1236 MrExcel.com
How to use LPAD,RPAD function in Oracle Sql
 
04:48
How to use LPAD,RPAD function in Oracle Sql
Views: 608 Tanmun
How to use tricky things with SYSDATE
 
04:59
How to use tricky things with SYSDATE like how to know the next day, next hour, next minuite etc.,
Views: 1235 Techie Rajesh
Round Function of MySQL in hindi
 
07:25
This video is made especially for students of class XI-XII who have opted Informatics Practices and Computer Science as a subject under the CBSE curriculum. In this, the structure of the CBSE exam paper is discussed and tips are given on how to crack this exam for the subject IP and C++. Contact Me : +91 8800873871 Mail Us : [email protected] Notes link:- https://csandip.blogspot.com/ Google maps:- https://maps.google.com/?cid=7786917265893947860 Must check and give a review
Views: 2295 ROHIT SINGH
Truncate statement in SQL Server - Part 19 Tamil
 
10:56
Subscribe to IT PORT : https://www.youtube.com/c/itport28 SQL Server Tutorial in Tamil : https://www.youtube.com/playlist?list=PLouAaeZ4xQ64enJDwWVvN3KduuZRlUrb3 SQL Server Concepts in Tamil : https://www.youtube.com/playlist?list=PLouAaeZ4xQ67kdNIByJKAGBIBhor_h4Hs SQL Server Analytic Functions in Tamil : https://www.youtube.com/playlist?list=PLouAaeZ4xQ65XIU5azEUgLVrBKEl-jWMV SQL Server Tutorial : https://www.youtube.com/playlist?list=PLouAaeZ4xQ66AYrzPtxt2SeeR4UABcBcO SQL Server Concepts : https://www.youtube.com/playlist?list=PLouAaeZ4xQ66zRe8-nDDy-YHY2o0rmbn4 SQL Server Analytic Functions : https://www.youtube.com/playlist?list=PLouAaeZ4xQ64hTsEdhLsVBquE1vERWngX TRUNCATE statement is used to Remove all rows from a table or specified partitions of a table, without logging the individual row deletions. TRUNCATE TABLE is similar to the DELETE statement with no WHERE clause; however, TRUNCATE TABLE is faster and uses fewer system and transaction log resources.
Views: 227 IT Port
SQL 37 b age calculation, Part 2
 
04:59
Age calculation, second part of the video. I had the divide this video into two parts. Both are available from youtube and www.my-uni.net
Views: 2633 hammadshams
Training Oracle 12c Bab 4: Using Single-Row Functions to Customize Output
 
12:27
SQL Workshop Training di http://www.optimacomputer.com
Sql Server tutorial || onlinetraining||date functions Part-1 by Narayana
 
25:22
DURGASOFT is INDIA's No.1 Software Training Center offers online training on various technologies like JAVA, .NET , ANDROID,HADOOP,TESTING TOOLS ,ADF,INFORMATICA,TABLEAU,IPHONE,OBIEE,ANJULAR JS, SAP... courses from Hyderabad & Bangalore -India with Real Time Experts. Mail us your requirements to [email protected] so that our Supporting Team will arrange Demo Sessions. Ph:Call +91-8885252627,+91-7207212428,+91-7207212427,+91-8096969696. http://durgasoft.com http://durgasoftonlinetraining.com https://www.facebook.com/durgasoftware http://durgajobs.com https://www.facebook.com/durgajobsinfo......