Selecting/casting output as integer in MySQL

Say, you have created a table asen_role_master with the field role_cd. The field role_cd takes only integer value. Now you want to get the maximum number with the MySql statement. So, for this you need to use cast as unsigned in your select statement. And will work perfectly.

Say, you have created a table asen_role_master with the field role_cd. The field role_cd takes only integer value. Now you want to get the maximum number with the MySql statement. So, for this you need to use cast as unsigned in your select statement. And will work perfectly.


For an example: 

Select max(CAST(role_cd as UNSIGNED)) as role_cd from asen_role_master

Related Blogs

pwd-system-asenwebmedia

How to remove sAntivirus | Segurazo Virus?

I have made this video "How to remove sAntivirus" only because I have troubled with this unwanted software and thought that if same type of problem arises for others then they can get help with this video as well as my blog. SAntivirus software or threat comes automatically in my laptop or it may come from other software installation from website or it may come any browser when installing extra browser plugins or browser extensions. There may be any reasons to come this virus as I was not aware of this..

pwd-system-asenwebmedia

How to backup databases in SQL server | cloud backup

To back up the database regularly is the most important part of any business or company. Not only the IT person, common employee should know the process of backup of SQL Server. This is very simple and easy to understand. I have made this video 'How to backup databases in SQL server' through Microsoft Visual Studio for those people who doesn't know how to do this. In information technology, a backup, or data backup is a copy of computer data taken and stored elsewhere so that it may be used to restore the original after a data loss event.

pwd-system-asenwebmedia

How to create a google account - what is gmail?

I have made this video "How to create a google account" for the youtube viewers and for those who does not know how to create a new google account. This is very basic introduction for the beginners. First open google chrome and search for as 'create google account' and then open the first link https://account.google.com then you will ask for your details to input like your first name, your last name, gmail id, password and confirm password and your phone number. So, input all the information correctly then click next and accept the agreement..

List of Categories

  • 5 Internet Basics
  • 14 PHP & MySql
  • 7 PHP & MSSQL SERVER
  • 2 How to trade in stock market