Wednesday 27 February 2019

MySql | Find Data Between Dates When Date Is Stored As Varchar | Str_to_date | Select Statement

Code:-

mysql> select * from employee where str_to_date(b_date,'%Y-%m-%d') between str_to_date('2019-2-26','%Y-%m-%d') and str_to_date('2019-2-30','%Y-%m-%d');
| id | name        | b_date    |
|  2 | tony stark  | 2019-2-26 |
|  4 | black widow | 2019-2-27 |
2 rows in set (0.00 sec)


mysql> desc employee;
| Field  | Type        | Null | Key | Default | Extra |
| id     | int(11)     | NO   | PRI | NULL    |       |
| name   | varchar(20) | YES  |     | NULL    |       |
| b_date | varchar(20) | YES  |     | NULL    |       |
3 rows in set (0.03 sec)


mysql> select * from employee;
| id | name         | b_date    |
|  1 | steve rogers | 2019-2-24 |
|  2 | tony stark   | 2019-2-26 |
|  3 | thor odinson | 2019-2-25 |
|  4 | black widow  | 2019-2-27 |

4 rows in set (0.06 sec)


Hello guys, this is unpossible pog and in this video, I shall teach you how to find data between two dates if they are stored as varchar as variable character.

First I shall start mysql by entering username and password.
Then I shall connect to the database, this is case, its sys.

Then as you can see the employee data with the birth dates.
But the b_date is stored as varchar.


So in mysql, there is a function called str_to_date() which converts text to date.
So type command like this in where condition, the first argument will be the column name, which is b_date. Then in second argument, there will be a pattern.
In my database, the pattern is the year – month – date. So I shall type percentage year – percentage month – percentage date.

Thank you for watching, Dont forget to like share and subscribe.






Thursday 14 February 2019

Youtube Video Manager Bug | 2019 | Bug And How Youtube Developers Can Fi...




On 14th of February 2019, I was checking my old videos inside video manager. By default, youtube's video manager shows videos from newest to oldest. So I was clicking on page links and I saw an unusual thing in my list. There was 2019 live stream within the list of 2016 videos. I don't know how that was happened. As a programmer, the possible things are.

1. It is a bug, means youtube coders neglected live stream video as as ascending order.

2. Maybe one employee changed the date and forgot to reenter it.

3. Some hacker intrude into youtube server and changed date.



Possible fix will be.

1.Go to my database table and change the date.

2. Check if someone hacked youtube or not.



Share this video to reach it to youtube CEO.

Friday 1 February 2019

Dance Battle In The Forest | Bhimashankar Trekking Via Ganesh Ghat | Hik...










This video is 1st part of the trip. This video will be about "what happened during the journey".
We decided to do the visit bhimashankar temple. There are 3 ways to reach to the temple,
1: By road
2: By Stairs
3: By hiking over the montain.
We chose the third option, that is to trek because our main goal is to look for an adventure and thrill.
After almost completely exhausted by hiking halfway over the mountains, we decided to take a little rest. But it was not fun sitting around in the middle of journey. So we start bluetooth speakers and play songs and we started dancing.