You can truncate the text with ellipsis using LENGTH() with CASE statement. If your length is greater than 7 then truncate the text and add some number otherwise print the number as it is.To understand the above syntax, let us create a table. The query to create a table is as follows:mysql> create table TruncateText -> ( -> Id int NOT NULL AUTO_INCREMENT, -> Number longtext, -> PRIMARY KEY(Id) -> ); Query OK, 0 rows affected (0.66 sec)Insert some records in the table using insert command. The query is as follows:mysql> insert into TruncateText(Number) values('64575868667687'); ... Read More
To create a table in MySQL that matches with another table, use CREATE TABLE command with LIKE operator. The syntax is as follows −create table yourNewTableName like yourOldTableName;The above syntax creates structure of the table.If you want all records then use INSERT INTO…...SELECT *FROM command. The syntax is as follows −insert into yourNewTableName select *from yourOldTableName.I have an old table and some data −mysql> create table WholeWordMatchDemo −> ( −> Words varchar(200) −> ); Query OK, 0 rows affected (0.84 sec)First, we will create a table structure. The query is as ... Read More
to know if MySQL binary log is enabled through SQL command, you can use show variables command.The syntax is as followsshow variables like ‘yourPatternValue’;In place of ‘yourPatternValue’, you can use log_bin to check the binary log is enabled using SQL command show.The query is as followsmysql> show variables like 'log_bin';The following is the output that displays whether it is enabled or not+---------------+-------+ | Variable_name | Value | +---------------+-------+ | log_bin | ON | +---------------+-------+ 1 row in set (0.03 sec)
The Leather is undoubtedly an expensive material as compared to its available counterparts. However, its luster and texture often get ruined with time. But we can avoid it if we handle it with a little care... gentlemen!!1. Let It Breathe: When we purchase a new leather belt, it is often packed in polythene. But once you start using it, use a cloth to cover it and wipe it off with a clean dry cloth.2. Hang Straight: Never swirl and bend your leather belt. Indeed hang it straight onto a hanger.3. Store It In Shade: Sunlight or any harsh radiant light tends ... Read More
The most important and irreplaceable files on your computer are your personal files. The windows system files etc. can be reinstalled, but your applications and your data are the most important files on your computer which have to be backed up periodically according to the changes and need.
For conditional NOT NULL case, you do not need to use and = operator. You need to use IS NULL and IS NOT NULL property because NULL is a special case in MySQL.To understand the conditional NOT NULL case, let us create a table. The query to create a table is as follows:mysql> create table ConditionalNotNullDemo -> ( -> Id int NOT NULL AUTO_INCREMENT, -> SendMessage longtext, -> PRIMARY KEY(Id) -> ); Query OK, 0 rows affected (0.62 sec)Insert some records in the table ... Read More
“If you educate one man you educate an individual, but, if you educate one woman you educate one whole family. Women empowered means mother India empowered”. - Pandit Jawaharlal NehruWomen Education in India today is not in an ideal state. Today, only 1 out of 100 girls gets access to higher education (College Education). While, women are excelling in different fields today, on one hand, the women in the masses are even today getting limited or no access to education on the other.The following points answer the question - how proper education to women can help in creating the empowerment ... Read More
You can display timezone easily in Java using SimpleDateFormat(“z”).Firstly, to work with SimpleDateFormat class in Java, import the following package −import java.text.SimpleDateFormat;Now, set the format with SimpleDateFormat(“z”) to display timezone −Format f = new SimpleDateFormat(”z”);Now, get the timezone in a string −String strTimeZone = f.format(new Date());The following is an example −Example Live Demoimport java.text.Format; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Calendar; public class Demo { public static void main(String[] args) throws Exception { // displaying current date and time Calendar cal = Calendar.getInstance(); ... Read More
To get today’s date, use in-built function CURDATE(). The CURDATE() gives only current date not time. With that, to get the records for the same day, you can try the following syntax −select yourColumnName1, yourColumnName2, ......, yourColumnNameN, DATE_FORMAT(yourDateColumnName, '%Y-%m-%d') from yourTableName WHERE DATE(yourDateColumnName) = CURDATE();To understand the above concept, let us create a table. The query to create a table is as follows. One of these columns will have datetime datatype to display dates −mysql> create table GmailSignIn −> ( −> UserId int, −> UserName varchar(200), −> DateOfSignIn ... Read More
Here are the simple steps to change the package name in android .Click on your pack name(in source tree). -> Right Click --> Refractor -> Rename as shown below -Click on rename, it will show pop up as shown below -Click on Rename package, it will show new pop up as shown below -Now change the name as per requirement and click on refractor as shown below -Now it will check all files and asks for refractor as shown below -In the below of Android studio, there is "do Refractor button". click on it. Now open your build.gradle as shown ... Read More