Ankith Reddy has Published 1070 Articles

Add a new value to a column of data type enum in MySQL?

Ankith Reddy

Ankith Reddy

Updated on 30-Jul-2019 22:30:24

20K+ Views

You can add a new value to a column of data type enum using ALTER MODIFY command.If you want the existing value of enum, then you need to manually write the existing enum value at the time of adding a new value to column of data type enum.The syntax is ... Read More

Python Binary Data Services

Ankith Reddy

Ankith Reddy

Updated on 30-Jul-2019 22:30:24

297 Views

Provisions of the struct module in the Python library are useful in performing conversions between C type structs and Python bytes objects. This can be achieved by module level functions as well as Struct class and its methods as defined in the struct module.The conversion functions use a format string. ... Read More

Get the first and last date of next month in MySQL?

Ankith Reddy

Ankith Reddy

Updated on 30-Jul-2019 22:30:24

818 Views

You can get the first and last date of next month using date_add() function from MySQL.The syntax is as follows -select date_sub(    last_day(       date_add(now(), interval anyIntervalTime)    ),    interval day(       last_day(          date_add(now(), interval anyIntervalTime)       ) ... Read More

Finding modules used by a Python script (modulefinder)

Ankith Reddy

Ankith Reddy

Updated on 30-Jul-2019 22:30:24

1K+ Views

The ModuleFinder class in 'modulefinder' module can determine set of modules imported by a certain script. This module has a command line interface as well as programmatic interface.For demonstration of functionality, use following script#modfinder.py import hello try: import trianglebrowser import nomodule, mymodule except ImportError: ... Read More

Is there a way in MySQL to reverse a boolean field with a single query?

Ankith Reddy

Ankith Reddy

Updated on 30-Jul-2019 22:30:24

717 Views

Yes, you can use if() function from MySQL to reverse a boolean field. The syntax is as follows −UPDATE yourTableName SET yourBooleanColumnName = IF(yourBooleanColumnName, 0, 1);To understand the above syntax, let us create a table. The query to create a table is as follows −mysql> create table ReverseBooleanField    -> ... Read More

How to quote values using MySQL group_concat?

Ankith Reddy

Ankith Reddy

Updated on 30-Jul-2019 22:30:24

922 Views

You can quote values using concat() and grop_concat() function from MySQL. The syntax is as follows −SELECT GROUP_CONCAT(CONCAT(' '' ', yourColumnName, ' '' ' )) as anyVariableName from yourTableName;To understand the above syntax, let us create a table. The query to create a table is as follows −mysql> create table ... Read More

MySQL Query a List of Values?

Ankith Reddy

Ankith Reddy

Updated on 30-Jul-2019 22:30:24

5K+ Views

To query a list of values, you can use IN operator. The syntax is as follows −SELECT * FROM yourTableName WHERE yourColumnName IN(Value1, Value2, ...N) ORDER BY FIELD(yourColumnName, Value1, Value2, ...N);To understand the above syntax, let us create a table. The query to create a table is as follows −mysql> ... Read More

How can I simulate an array variable in MySQL?

Ankith Reddy

Ankith Reddy

Updated on 30-Jul-2019 22:30:24

2K+ Views

Instead of simulating an array variable, use temporary table in MySQL. The syntax is as follows −create temporary table if not exists yourTemporaryTableName select yourColumnName1, yourColumnName2, ......N from yourTableName where conditionTo understand the above syntax, let us first create a table. The query to create a table is as follows ... Read More

How to get ER model of database from server with MySQL Workbench?

Ankith Reddy

Ankith Reddy

Updated on 30-Jul-2019 22:30:24

288 Views

To get ER model of database from server, you need to first launch MySQL Workbench. The snapshot is as follows −After that you need to select the “Database” menu −Database->Reverse EngineerAfter that a wizard will open as in the following screenshot. Add the password and press OK twice.After pressing the ... Read More

How to update RecyclerView Adapter Data in Android?

Ankith Reddy

Ankith Reddy

Updated on 30-Jul-2019 22:30:24

5K+ Views

Before getting into example, we should know what is Recycler view in android. Recycler view is more advanced version of list view and it works based on View holder design pattern. Using recycler view we can show grids and list of items.This example demonstrate about how to update Recycler View ... Read More

Advertisements