Learn how to use the TRUNC function to chop digits of numeric values returned from your database.
- Similarly to round, another SQL function…that allows us to deal with trailing digits…following a decimal point is the trunk function.…Trunk, unlike round, actually chops off numbers or digits…following a decimal point, instead of rounding them up.…Let's see it in action.…We'll start by selecting a…constant static value of 999.98765 from dual.…Selecting the value as is will return the value as is.…
However, adding the trunk function,…specifying the number inside brackets, comma…and how many digits I want to remain…after my decimal point, let's start with three.…Running the query again will change the output to 999.987…as the trunk function left me with three digits…following my decimal point.…The rest was chopped off.…Specifying one will modify my output…to one digit following the decimal point.…
And specifying zero will get rid…of all digits following the decimal point.…Note that trunk, unlike round,…will not round up or down any values.…And of course, instead of specifying a constant number,…we can also choose to specify a column, a numeric column,…
Note: This training course is appropriate for beginning database developers with no prior experience with SQL or Oracle.
- Using Oracle SQL*Developer, the free development environment
- Selecting data from tables
- Filtering data
- Using functions to manipulate data
- Joining data from tables
- Creating tables
- Updating values
- Truncating data
- Grouping and ordering result sets
- Working with primary keys
- Checking constraints
Skill Level Beginner
Oracle 12c Database: Administrationwith David Yahalom3h 58m Beginner
Database Foundations: Core Conceptswith Adam Wilbert2h 14m Beginner
Database Foundations: Administrationwith Adam Wilbert1h 14m Beginner
Learning Relational Databases (2014)with Adam Wilbert2h 39m Beginner
1. Introduction to SQL
2. Preparing the Course Environment
Downloading the course VM2m 16s
3. Using Oracle SQL Developer
4. Basic SELECT Queries
5. String, Number, and Date Functions
6. Joining Table Data
7. Manipulating Data
8. Grouping Data
9. Advanced Topics
Next steps1m 33s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.