Mohammad Towhidul Islam

    10-Aug-22 05:36:37 pm

    Coping table from one database to another database MySql

    CREATE TABLE vcampus.blackboard_topic_comment SELECT * FROM vcampus_2020.blackboard_topic_comment ...

    Read More


    Mohammad Towhidul Islam

    27-Nov-21 10:33:58 am

    Change MySQL user password

    Method1 For MySQL server version 5.7.6 or newer: ALTER USER 'jahid'@'localhost' IDENTIFIED BY '******'; Method2 For MySQL server version 5.7.5 or older: SET PASSWORD FOR 'jahid'@'hostname' = PASSWORD('*****'); OR SET PASSWORD FO...

    Read More


    Mohammad Towhidul Islam

    23-Nov-21 05:09:35 pm

    MySQL filter with like command

    1. Filter username start with a SELECT id, email, username, photo FROM users WHERE username LIKE 'a%'; 2. Filter username end with a SELECT id, email, username, photo FROM users WHERE username LIKE '%a'; 3. Filter username containing sh SELECT id, email, usern...

    Read More


    Mohammad Towhidul Islam

    23-Nov-21 04:58:00 pm

    MySQL alter commands

    1. Add column example: ALTER TABLE users ADD COLUMN mobile VARCHAR(20) UNIQUE; ALTER TABLE users ADD COLUMN mobile VARCHAR(20) AFTER email UNIQUE; ALTER TABLE users ADD COLUMN mobile VARCHAR(20) BEFORE email UNIQUE; 2. Add multiple columns example: ALTER TABLE users ADD COLUMN `count` S...

    Read More


    Mohammad Towhidul Islam

    22-Aug-20 04:20:56 pm

    Automatically delete records in child table when delete record in parent table using mysql trigger

    delimiter // drop trigger if exists ad_question_bank// create trigger ad_question_bank after delete on mcq_bank_master for each row begin delete from mcq_bank_details where question_id=old.id; end;// delimiter ; It will be automatically executed when delete command is applied in parent tab...

    Read More


    Mohammad Towhidul Islam

    22-Aug-20 03:40:46 pm

    Create mysql user with specified database of all privileges

    For the latest version create database if not exists wdpf_40_alam; drop user if exists alam@localhost; flush privileges; create user alam@localhost identified with mysql_native_password by 'alam@123'; GRANT ALL ON wdpf_40_alam.* TO alam@localhost; flush privileges; For old versi...

    Read More


    Mohammad Towhidul Islam

    22-Aug-20 03:06:42 pm

    Copy mysql table rows from one table to another table

    Copy to existing table with same structure including related table
    INSERT IGNORE INTO question_bank_certification SELECT * FROM mcq_bank_master where subject_id in(136); INSERT IGNORE INTO question_bank_certification_detials select * from mcq_bank_details where question_id in(select id...

    Read More


    Mohammad Towhidul Islam

    23-Dec-16 10:15:10 pm

    Query to swap row values in mysql

    First you have to create a tmp_field update item_uom_factor set factor=(select factor from item_uom_factor where item_id=5 and level=3) where level=2 and item_id=5 update item_uom_factor set factor=(select factor_tmp from item_uom_factor where item_id=5 and level=2) where level=3 and it...

    Read More


    Mohammad Towhidul Islam

    11-Dec-16 11:14:18 am

    How to update field by increment in mysql

    SET @a = 0; UPDATE item_master set order_by=(@a:=@a+1); ...

    Read More


    Mohammad Towhidul Islam

    17-Oct-15 11:41:49 am

    Understanding MySQL Cursor

    In this tutorial, you will learn how to use MySQL cursor in stored procedures to iterate through a result set returned by a SELECT statement. What is Cursor? Cursor in MySQL is almost same as cursor in other database. As per Wikipedia following is cursor definition. "In computer science ...

    Read More


First123Last
1 of 3 pages
Copyright © 2024. Powered by Intellect Software Ltd