Rama Giri has Published 107 Articles

Concatenating two strings in MySQL with space?

Rama Giri

Rama Giri

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

1K+ Views

For this, you can use concat() function from MySQL. Let us first create a table −mysql> create table DemoTable    -> (    -> Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,    -> Name varchar(20),    -> Subject varchar(100)    -> ); Query OK, 0 rows affected (17.73 sec)Insert some ... Read More

How to return rows that have the same column values in MySQL?

Rama Giri

Rama Giri

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

314 Views

Use GROUP BY clause for this. Let us first create a table −mysql> create table DemoTable    -> (    -> StudentId int,    -> StudentMarks int    -> ); Query OK, 0 rows affected (4.71 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(23, ... Read More

MySQL query to get only the minutes from datetime?

Rama Giri

Rama Giri

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

271 Views

Let us first create a table −mysql> create table DemoTable    -> (    -> ShippingDate datetime    -> ); Query OK,  0 rows affected (0.52 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('2019-01-10 10:04:45'); Query OK,  1 row affected (0.18 sec) mysql> insert into DemoTable values('2019-06-11 05:45:00'); Query OK,  1 row affected (0.23 sec) mysql> insert into DemoTable values('2019-06-12 07:00:55'); Query OK,  1 row affected (0.14 sec)Display all records from the table using select statement ... Read More

Concatenate date and time from separate columns into a single column in MySQL

Rama Giri

Rama Giri

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

296 Views

For this, concatenate both the date and time using CONCAT() function. Let us first create a table −mysql> create table DemoTable    -> (    -> ShippingDate date,    -> ShippingTime time,    -> ShippingDatetime datetime    -> ); Query OK, 0 rows affected (0.50 sec)Insert some records in the ... Read More

Display all records ignoring the current date record in MySQL

Rama Giri

Rama Giri

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

140 Views

Let us first create a table −mysql> create table DemoTable    -> (    -> Name varchar(100),    -> DueDate datetime    -> ); Query OK, 0 rows affected (0.54 sec)Insert some records in the table using insert command. Let’s say the current date is “2019-07-05” −mysql> insert into DemoTable ... Read More

Set numbers as a varchar field and compare in MySQL

Rama Giri

Rama Giri

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

198 Views

Let us first create a table −mysql> create table DemoTable    -> (    -> StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY,    -> StudentScore varchar(100)    -> ); Query OK, 0 rows affected (0.66 sec)Insert some records in the table using insert command −mysql> insert into DemoTable(StudentScore) values('90'); Query ... Read More

MySQL query to replace a string after the last / in a column with directory links?

Rama Giri

Rama Giri

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

148 Views

For this, use the substring_index() method. Let us first create a table −mysql> create table DemoTable    -> (    -> FolderName varchar(100),    -> FolderLocation varchar(200)    -> ); Query OK, 0 rows affected (1.03 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('CProgram', ... Read More

Select dates between current date and 3 months from the current date in MySQL?

Rama Giri

Rama Giri

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

2K+ Views

Use BETWEEN and INTERVAL to achieve this. Let us first create a table −mysql> create table DemoTable    -> (    -> AdmissionDate date    -> ); Query OK, 0 rows affected (0.84 sec)Insert some records in the table using insert command −mysql> insert into DemoTable  values('2019-09-30'); Query OK, 1 ... Read More

GROUP BY and display only non-empty column values in MySQL

Rama Giri

Rama Giri

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

1K+ Views

Let us first create a table −mysql> create table DemoTable    -> (    -> Id varchar(100),    -> Message varchar(200)    -> ); Query OK, 0 rows affected (1.17 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('1', ''); Query OK, 1 row affected ... Read More

How to show Alert Dialog in iOS?

Rama Giri

Rama Giri

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

2K+ Views

Knowing how to play with Alert is very important if you’re designing any iOS Application. Here we will be focusing on how to show Alert using UIAlertController.To read more about UIAlertController refer −  https://developer.apple.com/documentation/uikit/uialertcontrollerIn this, we will be creating a new project where we will have a button, on tapping ... Read More

Advertisements