<< < 7 8 9 10 11 12 13 >   ∑:311  Sort:Date

Updating Values in a Table in MySQL
How To Update Values in a Table in MySQL? If you want to update some values in one row or multiple rows in a table, you can use the UPDATE statement. The tutorial script below shows a good example: mysql&gt; UPDATE fyi_links SET counts = 999, notes = 'Good.' WHERE id = 101; Query OK, 1 row affec...
2018-01-13, 1329🔥, 0💬

Selecting Other User's Database in MySQL
Can You Select Someone Else Database in MySQL? If your MySQL server is provided by an Internet service company, they will provide you one database for your use only. There are many other databases on the server for other users. But your user account will have no privilege to select other databases. ...
2017-10-23, 1326🔥, 0💬

Entering Numeric Values as HEX Numbers in MySQL
How To Enter Numeric Values as HEX Numbers in MySQL? If you want to enter numeric values as HEX numbers, you can quote HEX numbers with single quotes and a prefix of (X), or just prefix HEX numbers with (0x). A HEX number string will be automatically converted into a numeric value, if the expression...
2018-03-31, 1323🔥, 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, 1323🔥, 0💬

Types of Table Joins in MySQL
How To Join Two Tables in a Single Query in MySQL? Two tables can be joined together in a query in 4 ways: Inner Join: Returns only rows from both tables that satisfy the join condition. Left Outer Join: Returns rows from both tables that satisfy the join condition, and the rest of rows from the fir...
2017-12-31, 1321🔥, 0💬

Sort by Multiple Columns in MySQL
Can the Query Output Be Sorted by Multiple Columns in MySQL? You can specifying multiple columns in the ORDER BY clause as shown in the following example statement, which returns employees' salaries sorted by department and salary value: mysql&gt; SELECT tag, counts, url, DATE(created) FROM fyi_...
2017-11-02, 1320🔥, 0💬

Adding More Data to the Test Table in MySQL
How To Add More Data to the Testing Table in MySQL? If you want to continue with other tutorial exercises in this FAQ collection, you need to add more data to the testing table. Follow the script below to add a new column and: mysql&gt; ALTER TABLE fyi_links ADD COLUMN tag VARCHAR(8); mysql&...
2017-11-02, 1319🔥, 0💬

Close MySQL Connection Objects in MySQL
How To Close MySQL Connection Objects in MySQL? MySQL connection objects created with mysql_connect() calls should be closed as soon as you have finished all of your database access needs by calling mysql_close($con) function. This will reduce the consumption of connection resources on your MySQL se...
2017-11-11, 1318🔥, 0💬

Selecting All Columns of All Rows in MySQL
How To Select All Columns of All Rows from a Table in MySQL? The simplest query statement is the one that selects all columns of all rows from a single table: "SELECT * FROM tableName;". The (*) in the SELECT clause tells the query to return all columns. The missing WHERE clause tells the query to r...
2017-11-05, 1314🔥, 0💬

Rename an Existing Table in MySQL
How To Rename an Existing Table in MySQL? If you want to rename an existing table, you can use the "ALTER TABLE ... RENAME TO" statement. The tutorial script below shows you a good example: mysql&gt; ALTER TABLE tip RENAME TO faq; Query OK, 0 rows affected (0.01 sec) mysql&gt; SELECT * FROM ...
2018-02-14, 1312🔥, 0💬

Rename an Existing User Account in MySQL
How To Rename an Existing User Account Name in MySQL? If you want to change the name of an existing user account, you can use the "RENAME USER oldName TO newName" command. The tutorial exercise below shows you how to do this: &gt;cd \mysql\bin &gt;mysql -u root -pretneciyf mysql mysql&gt...
2017-12-13, 1311🔥, 0💬

List All Tables with "mysql" Command in MySQL
How To Show All Tables with "mysql" in MySQL? If you want to see all the tables in a database, you run the non-SQL command "SHOW TABLES" at the "mysql" prompt. See the following tutorial exercise for example: &gt;cd \mysql\bin &gt;mysql -u root test Welcome to the MySQL monitor. Commands end...
2018-02-28, 1303🔥, 0💬

Entering Microseconds in SQL Statements in MySQL
How To Enter Microseconds in SQL Statements in MySQL? If you want to enter microseconds in a SQL statements, you can enter them right after the time string as a 6-digit number delimited with '.'. '0' will be padded to right if not enough digits. Here are some good examples: SELECT TIME('1997/01/31 0...
2017-12-26, 1301🔥, 0💬

Creating a New Database in MySQL
How To Create a New Database in MySQL? A database in a MySQL server is a logical container used to group tables and other data objects together as a unit. If you are the administrator of the server, you can create a new databases using the CREATE DATABASE statements with MySQL client interface progr...
2017-11-11, 1301🔥, 0💬

What Is a SELECT Query Statement in MySQL
What Is a SELECT Query Statement in MySQL? The SELECT statement is also called the query statement. It is the most frequently used SQL statement in any database application. A SELECT statement allows you to retrieve data from one or more tables or views, with different selection criteria, grouping c...
2017-11-05, 1299🔥, 0💬

Using Group Functions in the ORDER BY Clause in MySQL
Can Group Functions Be Used in the ORDER BY Clause in MySQL? If the query output is aggregated as groups, you can sort the groups by using group functions in the ORDER BY clause. The following statement returns how many links were created in each year in each tag. The group output is sorted by the c...
2017-12-31, 1297🔥, 0💬

Running MySQL Server on a Specific Port in MySQL
How To Run MySQL Server on a Different Port in MySQL? By default, MySQL will listen at port number 3306 for any client connections. But you can change this by starting the server with "--port=portNumber" option. The tutorial exercise shows you how to start the server to listen to a different port nu...
2017-11-29, 1297🔥, 0💬

Counting Groups Returned from GROUP BY in MySQL
How To Count Groups Returned with the GROUP BY Clause in MySQL? If you use the COUNT(*) function on groups returned with the GROUP BY clause, it will count the number of rows within each group, not the number of groups. If you want to count the number of groups, you can put the GROUP BY query into a...
2017-12-21, 1289🔥, 0💬

Inserting Rows with a SELECT Statement in MySQL
How To Insert Multiple Rows with a SELECT Statement in MySQL? If want to insert rows into a table based on data rows from other tables, you can use a sub-query inside the INSERT statement as shown in the following script example: &lt;?php include "mysql_connection.php"; $sql = "INSERT INTO fyi_l...
2017-09-20, 1279🔥, 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, 1246🔥, 0💬

Selecting Columns in a Query in MySQL
How To Select Some Columns from a Table in MySQL? If you want explicitly tell the query to return some columns, you can specify the column names in the SELECT clause. The following select statement returns only two columns, "id" and "url" from the table "fyi_links": mysql&gt; SELECT id, url FROM...
2017-11-05, 1238🔥, 0💬

TRUNCATE() - Truncating to Decimal Place
How to truncate a value to a given decimal place using the TRUNCATE() function? TRUNCATE(X, D) is a MySQL built-in function that truncates X to decimal place of D. For example: SELECT TRUNCATE(-1.58, 0), TRUNCATE(23.298, 1), TRUNCATE(23.298, -1); -- +--------------------+-------- -------------+------...
2023-11-14, 329🔥, 0💬

MAKE_SET() - Filtering List with Binary Set
How to filter a list of strings with a binary set provided as an integer using the MAKE_SET() function? MAKE_SET(bits, str1, str2, ...) is a MySQL built-in function that filters a list of strings with a binary set provided as an integer. It loops through every bit of the given integer "bits" startin...
2023-12-20, 325🔥, 0💬

SUM() - Total Value in Group
How to calculate the total value of a field expression in result set groups using the SUM() function? SUM(expr) is a MySQL built-in aggregate function that calculates the total value of a field expression in result set groups. For example: SELECT help_category_id, SUM(help_topic_id), COUNT(help_topi...
2023-12-01, 317🔥, 0💬

<< < 7 8 9 10 11 12 13 >   ∑:311  Sort:Date