EXPORT_SET() function in MySQL Last Updated : 30 Dec, 2020 Summarize Comments Improve Suggest changes Share Like Article Like Report EXPORT_SET() : This function helps to return a string which will show the bits in number. The function requires 5 arguments for its functioning. The function converts first argument i.e integer to binary digits, then returns “on” if binary digit is 1 and “off” if binary digit is 0. Syntax : EXPORT_SET (bits, on, off, separator, number of bits) Parameters : This function accepts 5 arguments. bits - The integer number for which the result will be formatted. on - If the binary digit is 1, then it will return. off - If the binary digit is 0, then it will return. separator - The separator which will be placed between returned values. number of bits - The number of bits in which the result will come Returns : This function will return a string that will show the bits in number. Example-1 : General working of EXPORT_SET() function. SELECT EXPORT_SET(10, 'On', 'Off', ':', 5) AS Export; Output : ExportOff : On : Off : On : Off Example 2 : Working of EXPORT_SET() function by changing 2nd and 3rd arguments. Using “Y” and “N” as second and third argument respectively - SELECT EXPORT_SET(11, 'Y', 'N', ', ', 4) AS Export; Output : ExportY, Y, N, Y Using “1” and “0” as second and third argument respectively - SELECT EXPORT_SET(11, 1, 0, ', ', 4) AS Export; Output : Export1, 1, 0, 1 Example-3 : Working of EXPORT_SET() function by changing 4th argument. Using “-” as the fourth argument - SELECT EXPORT_SET(10, 1, 0, '-', 4) AS Export; Output : Export0-1-0-1 Using “::” as the fourth argument - SELECT EXPORT_SET(10, 1, 0, '::', 4) AS Export; Output : Export0::1::0::1 Example-4 : Working of EXPORT_SET() function by changing 5th argument. Using 10 as the fifth argument - SELECT EXPORT_SET(9, 'Y', 'N', ' ', 10) AS Export; Output : ExportY N N Y N N N N N N Using 20 as the fifth argument - SELECT EXPORT_SET(9, 1, 0, ' ', 20) AS Export; Output : Export1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Comment More infoAdvertise with us Next Article FIND_IN_SET() Function in MySQL V vanshgaur14866 Follow Improve Article Tags : Technical Scripter SQL Technical Scripter 2020 DBMS-SQL mysql +1 More Similar Reads ELT() Function in MySQL In this article, we are going to cover ELT function with examples. In ELT function, number field will state that how many strings will be there. ELT function in MySQL is used to returns the string which is at index number specified in the argument list. In this function there is number field and str 1 min read FIND_IN_SET() Function in MySQL The FIND_IN_SET() function in MySQL is a powerful tool for searching within comma-separated lists of strings. It allows you to locate the position of a specific string within a list and is commonly used in cases where lists are stored as strings within a database.In this article, We will learn about 2 min read CURRENT_TIME() function in MySQL In MySQL, the CURRENT_TIME() function is a valuable tool for retrieving the current system time from the server, providing the exact time in hours, minutes, and seconds. It is widely used in scenarios where tracking or querying the current time is essential without needing the full date. In this art 3 min read TIME() Function in MySQL The TIME() function in MySQL is used to extract the time portion from a date or datetime expression, returning the time in the format 'HH:MM'. This function is particularly useful when working with time components in databases, such as scheduling or logging systems. In this article, We will learn ab 4 min read CURTIME() function in MySQL CURTIME() function in MySQL is used to check the current time. It returns the current time as a value in âhh:mm:ssâ or 'hhmmss' format, depending on whether the function is used in a string or numeric context. Syntax : CURTIME(fsp) Parameters : This method accepts only one parameter. fsp - It specif 2 min read FIELD() function in MySQL FIELD() : This function helps in returning the position of a value in the given value list. If the user passes string values as the argument of FIELD() function, then the search will be performed as string values. And, If the user passes numeric values as the argument of FIELD() function, then searc 2 min read Like