MySQL provides a LIMIT clause that is used to specify the number of records to return. The LIMIT clause makes it easy to code multi page results or pagination with SQL, and is very useful on large tables. Assume we wish...
1. Using MyISAM rather than InnoDB MySQL has a number of database engines, but you’re most likely to encounter MyISAM and InnoDB. MyISAM is used by default. However, unless you’re creating a very simple or experimental database, it’s almost certainly the...
By running below query you can able to get the Current Timezone of the database server. select timediff(now(),convert_tz(now(),@@session.time_zone,’+00:00′));...
Check below on How to Add a Column to Mysql Table with Auto Increment and Primary Key You can achieve it by doing Alter Command: Add Column to Mysql To Modify Column and add Auto Increment with Primary Key Query: ALTER...
To Get Data Base Size in MB and Free Space in MBSELECT table_schema “dbName”, sum( data_length + index_length ) / 1024 / 1024 “Data Base Size in MB”, sum( data_free )/ 1024 / 1024 “Free Space in MB”FROM information_schema.TABLESGROUP...
You can find duplicate rows in the mysql table, just use below select query, to find duplicate rows in Oracle, Sql, Mysql, DB2. SELECT columnName, COUNT(*) as countFROM selectedTableGROUP BY columnNameHAVING COUNT(*) > 1; You came from below query:how to find...
Below simple program will export mysql data values to excel sheet without using any PHP libraries. Export to Excel Using PHP and Mysql Note: IF you get errors or in excel all the data is in one column, then instead t...
If you want to loop throuh the mysql result set twice then use below way. $result = mysql_query("SELECT * FROM my_table");while($row = mysql_fetch_assoc($result)) {// inside the loop} The problem is, if you want to loop through the same result set again,...