MySQL Archives - CodexWorld https://www.codexworld.com/how-to-category/mysql/ Web & Mobile App Development Company Thu, 09 Dec 2021 14:08:12 +0000 en-US hourly 1 https://www.codexworld.com/wp-content/uploads/2020/04/favicon.ico MySQL Archives - CodexWorld https://www.codexworld.com/how-to-category/mysql/ 32 32 91409221 How to Update Field to Subtract Value from Existing Field Value in MySQL but Not Negative https://www.codexworld.com/how-to/update-field-to-subtract-value-from-existing-field-value-in-mysql-but-not-negative/ https://www.codexworld.com/how-to/update-field-to-subtract-value-from-existing-field-value-in-mysql-but-not-negative/#respond Thu, 09 Dec 2021 14:08:12 +0000 https://www.codexworld.com/?post_type=how-to-guides&p=4789 The UPDATE and SET commands help to update existing field values in MySQL. You can use these commands to add/subtract value to/from existing field value in a single query in MySQL. Use the GREATEST() method with the UPDATE and SET command to subtract the value from an existing field in MySQL but not a negative value.

The post How to Update Field to Subtract Value from Existing Field Value in MySQL but Not Negative appeared first on CodexWorld.

]]>
https://www.codexworld.com/how-to/update-field-to-subtract-value-from-existing-field-value-in-mysql-but-not-negative/feed/ 0 4789
How to Select Random Records in MySQL? https://www.codexworld.com/how-to/select-random-records-in-mysql/ https://www.codexworld.com/how-to/select-random-records-in-mysql/#respond Mon, 29 Jun 2020 13:27:28 +0000 https://www.codexworld.com/?post_type=how-to-guides&p=4448 MySQL RAND() function provides an easy way to select random rows from the table. You can get random records from the database using a single SQL query in MySQL. If you want to list the unique data on each page load, the random records feature is very useful. Use MySQL RAND() function to select random records from the table.

The post How to Select Random Records in MySQL? appeared first on CodexWorld.

]]>
https://www.codexworld.com/how-to/select-random-records-in-mysql/feed/ 0 4448
How to Sort Results Order by Best Match using LIKE in MySQL https://www.codexworld.com/how-to/sort-results-order-by-best-match-using-like-in-mysql/ https://www.codexworld.com/how-to/sort-results-order-by-best-match-using-like-in-mysql/#comments Tue, 08 Jan 2019 12:29:52 +0000 https://www.codexworld.com/?post_type=how-to-guides&p=3743 When you use LIKE operator to search and fetch the matched results from the database, the records are selected based on their entry. In LIKE search, the results must be sorted based on the word matches to make the result-set more relevance. Use ORDER BY keyword with LIKE to sort results by the best match in MySQL.

The post How to Sort Results Order by Best Match using LIKE in MySQL appeared first on CodexWorld.

]]>
https://www.codexworld.com/how-to/sort-results-order-by-best-match-using-like-in-mysql/feed/ 6 3743
How to Get the Column Names from Table in MySQL using PHP https://www.codexworld.com/how-to/get-column-names-from-table-in-mysql-php/ https://www.codexworld.com/how-to/get-column-names-from-table-in-mysql-php/#comments Mon, 08 Oct 2018 11:54:12 +0000 https://www.codexworld.com/?post_type=how-to-guides&p=3531 The SHOW COLUMNS syntax shows the information about columns in a specified table. The INFORMATION_SCHEMA is the best way to get the columns of a table in MySQL. If you want to get the table columns from the PHP script, use INFORMATION_SCHEMA to select column names from a table in MySQL.

The post How to Get the Column Names from Table in MySQL using PHP appeared first on CodexWorld.

]]>
https://www.codexworld.com/how-to/get-column-names-from-table-in-mysql-php/feed/ 1 3531
How to Insert Data from One Table to Another in MySQL https://www.codexworld.com/how-to/insert-data-from-one-table-to-another-mysql/ https://www.codexworld.com/how-to/insert-data-from-one-table-to-another-mysql/#comments Wed, 26 Apr 2017 05:31:14 +0000 https://www.codexworld.com/?post_type=how-to-guides&p=2358 MySQL INSERT ... SELECT statement provides an easy way to insert rows into a table from another table. If you want to copy data from one table to another in the same database, use INSERT INTO SELECT statement in MySQL.

The post How to Insert Data from One Table to Another in MySQL appeared first on CodexWorld.

]]>
https://www.codexworld.com/how-to/insert-data-from-one-table-to-another-mysql/feed/ 8 2358
MySQL Query to Delete Duplicate Rows from Table https://www.codexworld.com/how-to/mysql-query-delete-duplicate-rows-from-table/ https://www.codexworld.com/how-to/mysql-query-delete-duplicate-rows-from-table/#respond Fri, 20 Nov 2015 18:30:49 +0000 https://www.codexworld.com/?post_type=how-to-guides&p=1025 Are you want to delete duplicate rows from MySQL table? Using one MySQL query, you can remove duplicate records from table.

The post MySQL Query to Delete Duplicate Rows from Table appeared first on CodexWorld.

]]>
https://www.codexworld.com/how-to/mysql-query-delete-duplicate-rows-from-table/feed/ 0 1025