<< < 19 20 21 22 23 24 25 26 27 28 29 > >>   ∑:1243  Sort:Rank

Converting Character Strings to Numeric Values in MySQL
How To Convert Character Strings to Numeric Values in MySQL? You can convert character strings to numeric values by using the CAST(string AS DECIMAL) or CAST(string AS SIGNED INTEGER) function as shown in the following examples: SELECT CAST('4123.45700' AS DECIMAL) FROM DUAL; 4123.46 -- Very poor co...
2018-03-28, 1442🔥, 0💬

Using IN Conditions in MySQL
How To Use IN Conditions in MySQL? An IN condition is single value again a list of values. It returns TRUE, if the specified value is in the list. Otherwise, it returns FALSE. Some examples are given in the tutorial exercise below: SELECT 3 IN (1,2,3,4,5) FROM DUAL; 1 SELECT 3 NOT IN (1,2,3,4,5) FRO...
2018-03-28, 1430🔥, 0💬

What Is NULL Value in MySQL
What Are NULL Values in MySQL? NULL is a special value that represents no value. Here are basic rules about NULL values: NULL presents no value. NULL is not the same as an empty string ''. NULL is not the same as a zero value 0. NULL can be used as any data type. NULL should not be used in any compa...
2018-03-28, 1423🔥, 0💬

Expressions with NULL Values in MySQL
What Happens If NULL Values Are Involved in Expressions in MySQL? If NULL values are used in expressions, the resulting values will be NULL values. In other words: Arithmetic expressions with NULL values result NULL values. Comparison expressions with NULL values result NULL values. Logical expressi...
2018-03-28, 1325🔥, 0💬

Using CASE Expression in MySQL
How To Use CASE Expression in MySQL? There are 2 ways to use the CASE expression. The first way is to return one of the predefined values based on the comparison of a given value to a list of target values. The second way is to return one of the predefined values based on a list of conditions. Here ...
2018-03-24, 1552🔥, 0💬

Using Regular Expression with REGEXP in MySQL
How To Use Regular Expression in Pattern Match Conditions in MySQL? If you have a pattern that is too complex for LIKE to handle, you can use the regular expression pattern condition: REGEXP. The following tutorial exercise provides you some good examples: SELECT 'FYICenter.com' REGEXP '.*fyi.*' FRO...
2018-03-24, 1479🔥, 0💬

What are Date and Time Data Types in MySQL
What Are Date and Time Data Types in MySQL? MySQL supports the following date and time data types: DATE - A date in the range of '1000-01-01' and '9999-12-31'. Default DATE format is "YYYY-MM-DD". DATETIME - A date with the time of day in the range of '1000-01-01 00:00:00' and '9999-12-31 23:59:59'....
2018-03-24, 1448🔥, 0💬

Using LIKE Conditions in MySQL
How To Use LIKE Conditions in MySQL? A LIKE condition is also called pattern patch. There are 3 main rules on using LIKE condition: '_' is used in the pattern to match any one character. '%' is used in the pattern to match any zero or more characters. ESCAPE clause is used to provide the escape char...
2018-03-24, 1249🔥, 0💬

Formal Parameters and Actual Parameters in Oracle
What Is the Difference between Formal Parameters and Actual Parameters in Oracle? Formal parameter and actual parameter are two different terms related parameters used in the procedures and functions: A formal parameter is a term used to refer to a parameter defined in the procedure or function decl...
2018-03-18, 2266🔥, 0💬

Call Procedure or Function Recursively in Oracle
Can Sub Procedure/Function Be Called Recursively in Oracle? PL/SQL allows sub procedures or functions to be called recursively. The tutorial example below shows you how to calculate factorial values with a recursive sub function: SQL&gt; CREATE OR REPLACE PROCEDURE FACTORIAL_TEST AS 2 FUNCTION F...
2018-03-18, 1803🔥, 0💬

Define a Sub Function in Oracle
How To Define a Sub Function in Oracle? A sub function is a function defined and used inside another procedure or function. You need to define a sub function in the declaration part of the enclosing procedure or function. Sub function definition starts with the FUNCTION key word. Here is a sample sc...
2018-03-18, 1773🔥, 0💬

Run-Away Recursive Calls in Oracle
What Happens If Recursive Calls Get Out of Control in Oracle? What happens if your code has bug on recursive procedure calls, which causes an infinite number nested procedure calls? The answer is not so good. Oracle server seems to offer no protection calling stack limit. The script below shows you ...
2018-03-18, 1553🔥, 0💬

Define Variables before Procedures and Functions in Oracle
What Is the Order of Defining Local Variables and Sub Procedures/Functions in Oracle? In the declaration part, you must define all local variables before defining any sub procedures or sub functions. See the following sample script: SQL&gt; CREATE OR REPLACE PROCEDURE WELCOME AS 2 SITE CHAR(80) ...
2018-03-18, 1372🔥, 0💬

Date and Time Functions in MySQL
What Are Date and Time Functions in MySQL? MySQL offers a number of functions for date and time values: ADDDATE(date, INTERVAL expr unit) - Adding days to a date. Same as DATE_ADD(). ADDTIME(time1, time2) - Adding two time values together. CURDATE() - Returning the current date. Same as CURRENT_DATE...
2018-03-13, 3310🔥, 0💬

CREATE, ALTER and DROP Statements in MySQL
Where to find answers to frequently asked questions on CREATE, ALTER and DROP Statements in MySQL? Here is a list of frequently asked questions and their answers compiled by FYIcenter.com DBA team on CREATE, ALTER and DROP Statements in MySQL. Clear answers are provided with tutorial exercises on cr...
2018-03-13, 3088🔥, 0💬

Ways to Get the Current Time in MySQL
How Many Ways to Get the Current Time in MySQL? There are 8 ways to get the current time: SELECT NOW() FROM DUAL; 2006-07-01 10:02:41 SELECT CURRENT_TIME() FROM DUAL; 10:02:58 SELECT SYSDATE() FROM DUAL; 2006-07-01 10:03:21 mysql&gt; SELECT CURRENT_TIMESTAMP() FROM DUAL; 2006-07-01 10:04:03 SELE...
2018-03-13, 2715🔥, 0💬

What Is TIMESTAMP Data Type in MySQL
What Is TIMESTAMP Data Type in MySQL? A TIMESTAMP data type allows you to record a date and time like DATETIME data type. But it has some interesting features when used on a table column: The first TIMESTAMP column in a table will be assigned with the current date and time, if it is not listed in an...
2018-03-13, 1649🔥, 0💬

Extract Unit Values from a Date and Time in MySQL
How To Extract a Unit Value from a Date and Time in MySQL? If you want to extract a specific date or time unit value out of a date or a time, you can use the EXTRACT(unit FROM expression) function. The tutorial exercise below gives you some good examples: ELECT EXTRACT(DAY FROM NOW()) FROM DUAL; 28 ...
2018-03-13, 1484🔥, 0💬

CREATE Command Denied Error in MySQL
What Happens If You No CREATE Privilege in a Database in MySQL? In order to create tables in a database, your user account must have the CREATE privilege for that database. Otherwise you will get an error as shown in the following tutorial exercise: &gt;cd \mysql\bin &gt;mysql -u guest -ppub...
2018-03-10, 2315🔥, 0💬

Show All Columns of an Existing Table in MySQL
How To Get a List of Columns in an Existing Table in MySQL? If you have an existing table, but you don't remember what are the columns used in the table, you can use the "SHOW COLUMNS FROM tableName" command to get a list of all columns of the specified table. You can also use the "DESCRIBE tableNam...
2018-03-10, 1947🔥, 0💬

What Are DDL Statements in MySQL
What Are DDL Statements in MySQL? DDL (Data Definition Language) statements are statements to create and manage data objects in the database. The are 3 primary DDL statements: CREATE - Creating a new database object. ALTER - Altering the definition of an existing data object. DROP - Dropping an exis...
2018-03-10, 1528🔥, 0💬

Show All Tables in a Database in MySQL
How To Get a List of All Tables in a Database in MySQL? If you want to see the table you have just created, you can use the "SHOW TABLES" command to get a list of all tables in database. The tutorial script gives you a good example: mysql&gt; SHOW TABLES; +---------------+ | Tables_in_fyi | +---...
2018-03-10, 1477🔥, 0💬

CREATE TABLE Statement in MySQL
How To Create a New Table in MySQL? If you want to create a new table, you can use the "CREATE TABLE" statement. The following tutorial script shows you how to create a table called "tip": mysql&gt; CREATE TABLE tip (id INTEGER PRIMARY KEY, subject VARCHAR(80) NOT NULL, description VARCHAR(256) ...
2018-03-10, 1423🔥, 0💬

Rename an Existing Column in a Table in MySQL
How To Rename an Existing Column in a Table in MySQL? If you have an existing column in a table and you want to change the column name, you can use the "ALTER TABLE ... CHANGE" statement. This statement allows you to change the name of a column, and its definition. The tutorial script below gives yo...
2018-03-04, 1635🔥, 0💬

<< < 19 20 21 22 23 24 25 26 27 28 29 > >>   ∑:1243  Sort:Rank