

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What does a “set+0” in a MySQL statement do?
The set+0 converts the set value to integer. Let us see an example by creating a table −
mysql> create table SetZeroDemo -> ( -> Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, -> TechnicalSkills set('C','Spring Framework /Hibernate','Python','Django Framework','Core Java') NOT NULL -> ); Query OK, 0 rows affected (0.56 sec)
Insert some records in the table using insert command. The query is as follows −
mysql> insert into SetZeroDemo(TechnicalSkills) -> values('C,Spring Framework /Hibernate,Python,Django Framework,Core Java'); Query OK, 1 row affected (0.20 sec)
Display all records from the table using select statement. The query is as follows −
mysql> select *from SetZeroDemo;
Here is the output −
+----+-----------------------------------------------------------------+ | Id | TechnicalSkills | +----+-----------------------------------------------------------------+ | 1 | C,Spring Framework /Hibernate,Python,Django Framework,Core Java | +----+-----------------------------------------------------------------+ 1 row in set (0.00 sec)
Here is the query to set+0 in MySQL statement −
mysql> select TechnicalSkills+0 from SetZeroDemo;
The following is the output −
+-------------------+ | TechnicalSkills+0 | +-------------------+ | 31 | +-------------------+ 1 row in set (0.00 sec)
Now, let us see how the result above is 31.
It starts from 0 till the insert value. In the above table there are 5 words that means it starts from power 0 to 4 (because there are 5 words) as shown below −
=20+21+22+23+24 =1+2+4+8+16 =15+16 =31
- Related Questions & Answers
- What does “javascript:void(0)” mean?
- What does .shape[] do in “for i in range(Y.shape[0])” using Matplotlib?
- What does the “yield” keyword do in Python?
- MySQL procedure to display a “select” statement twice
- Why does Lua have no “continue” statement?
- What is “where 1=1” statement in MySQL?
- What does “?:” mean in a Python regular expression?
- What does “dereferencing” a pointer mean in C/C++?
- How does “do something OR DIE()” work in Perl?
- Which one is better to use for a JavaScript link, “#” or “javascript:void(0)”?
- What does the operator || do in a var statement in JavaScript?
- What does “unsigned” in MySQL mean and when to use it?
- Why in JavaScript, “if ('0' == false)” is equal to false whereas it gives true in “if(0)” statement?
- What does “use strict” do in JavaScript, and what is the reasoning behind it?
- How to front pad zip code with “0” in MySQL?
Advertisements