Тёмный
No video :(

How to calculate difference between two timestamps in SQL | Datediff in sql | Ashutosh Kumar 

Ashutosh Kumar
Подписаться 19 тыс.
Просмотров 15 тыс.
50% 1

Sql one of the most important language asked in most of the analytics interviews, in this video i am discussing about a very important concept in sql which is calculating difference between two timestamp in terms of hours , minutes and seconds using datediff function in sql. So do watch the video till the very end.
👉 Query -
drop table if exists details;
CREATE TABLE details(Timing1 TIME, Timing2 TIME);
INSERT INTO details(Timing1,Timing2)
VALUES('10:50:00','12:30:00'),
('12:30:00','13:52:00'),
('05:45:00','09:00:00');
select * from details;
👉 Complete playlist on Sql Interview questions and answers
• HackerRank SQL problem...
---------------------------------------------------------------------------------------------------------------------
Check out some more relevant content here
👉 How to Learn SQL
• How to learn sql for b...
👉 How to become a business analyst complete roadmap-
• Business Analyst Compl...
👉 How to become a data analyst complete roadmap-
• Data Analyst Complete ...
👉 Top 3 you tube channels to learn sql for free for beginners
• Video
👉 Rank ,Dense Rank, Row Number in sql -
• RANK - DENSE RANK - RO...
👉 Cross join in sql
• CROSS JOIN SQL
👉 union join in sql
• UNION IN SQL
👉 left join in sql
• LEFT JOIN IN SQL
👉 Right join in sql
• RIGHT JOIN IN SQL
👉 Inner join in sql
• INNER JOIN IN SQL
👉 Introduction to tables and databases in sql -
• INTRO TO TABLES AND DA...
👉 Aggregate Function in sql
• AGGREGATE FUNCTION IN SQL
👉 Functions in sql-
• IMPORTANT FUNCTIONS IN...
👉 String Function in sql
• STRING FUNCTIONS IN SQL
👉 CRUD operations in sql
• CREATE- READ- UPDATE-D...
👉 Autoincrement in sql
• Auto Increment in SQL ...
👉 Primary Key in sql-
• PRIMARY KEYS IN SQL - SQL
👉 Null and Default values in sql-
• NULL AND DEFAULT VALUE...
👉 Data types in sql-
• Data types in Sql - SQL
____________________________________________________________________
Fill the form below to subscribe yourself to the analytics jobs mailing list to receive regular job opening updates - docs.google.co...
Why you should definitely fill the analytics job updates google form - • Job Openings into busi...
_______________________________________________________________________
Connect with me
📸Instagram - / ashutosh.analytics
💻Linkedin- / ashutoszh
_____________________________________________________________________
Comment down if you have any doubts
Please leave a LIKE 👍 and SUBSCRIBE ❤️ to my channel to receive more amazing content in data analytics and data science.
_____________________________________________________________________
🏷️ Tags
sql,
sql for data science,
sql for data analytics,
sql practise questions,
sql practise questions and solutions,
sql tutorials for beginners,
sql problems for data engineers,
ashutosh,
ashutosh kumar,
ashutosh kumar analytics,
sql problems easy,
sql problem medium,
sql problems hard,
sql window functions,
sql advanced questions,
rank functions in sql,
lag lead in sql,
sql interview questions and answers,
sql interview questions,
sql questions asked in interviews,
hackerrank sql solutions,
hackerearth sql solutions,
leetcode sql solution
🏷️HashTags
#sql #interviews #questions #solutions

Опубликовано:

 

20 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 31   
@AshutoshKumaryt
@AshutoshKumaryt Год назад
👉 SQL Portfolio Project Indian Census- Part 1 ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-I3YvjFfn478.html 👉 Advanced Sql Concepts Complete Playlist ru-vid.com/group/PLbTF1OfX62c3RQ_ZFfyNBWVPdz_OWTMLG
@hasanmougharbel8030
@hasanmougharbel8030 Год назад
Hey there, glad to meet again. I learned about timestamp as a date data type. My question is, if i where to record timestamps of every record entered into the database. Would the sql server generate two identical timestamps given the records where run simultaneously..is that case a hypothetical one or would it happen? Thanks for taking care of this.
@AshutoshKumaryt
@AshutoshKumaryt Год назад
your question sounds interesting but can you please elaborate
@SACHINKUMAR-px8kq
@SACHINKUMAR-px8kq Год назад
Thanks Sir , Sir Please Comeup with New SQL Projects
@insidehead
@insidehead Год назад
select *, timediff(lead(time) over(partition by `train id` order by time),time) as "duration till next station" from trains;
@debabrataroy1777
@debabrataroy1777 3 месяца назад
Time difference is negative when Timing1=23:58:00 and Timing2=00:13:00. How to fix it?
@devikavaidya5897
@devikavaidya5897 2 месяца назад
Thank u for this video, but i want to calculate sum of different time stamps can u please help me
@nagasai5243
@nagasai5243 Год назад
Pls tell me how to find the time period of the given dataset
@AshutoshKumaryt
@AshutoshKumaryt Год назад
pls elaborate
@funnybhadrakia1
@funnybhadrakia1 Год назад
useful concept
@AshutoshKumaryt
@AshutoshKumaryt Год назад
Thanks
@user-om6tz9us7z
@user-om6tz9us7z 7 месяцев назад
Ticket create date : 05/01/2024 09:30 AM, Ticket closing date: 07/01/2024 12:30 PM, I want the total duration but after 09 pm to 09 am i dont want to count the hours, whats the excel formula. please help.
@GauravMalhotra-cm1re
@GauravMalhotra-cm1re 2 месяца назад
Much easier way :- SELECT CONCAT( HOUR(TIMEDIFF(Timing2, Timing1)), ' hours ', MINUTE(TIMEDIFF(Timing2, Timing1)), ' minutes ', SECOND(TIMEDIFF(Timing2, Timing1)), ' seconds' ) AS TimeDifference FROM Time;
@ildodossantos3807
@ildodossantos3807 11 месяцев назад
Many thanks
@AshutoshKumaryt
@AshutoshKumaryt 11 месяцев назад
Thanks
@ashuborole4079
@ashuborole4079 8 месяцев назад
Hi I am working in oracle apex but their datediff is not working can you suggest any another please
@raghavmittal7112
@raghavmittal7112 2 года назад
Bro tumhare se personal contact kaise ho skta h .. want to make you mentor in my data science journey you are teaching great stuff
@AshutoshKumaryt
@AshutoshKumaryt 2 года назад
Sure you can reach out to me on instagram @ashutosh.analytics
@raghavmittal7112
@raghavmittal7112 2 года назад
Bro LinkedIn profile aur share krdo .. mein Instagram nhi use krta hu
@AshutoshKumaryt
@AshutoshKumaryt 2 года назад
@@raghavmittal7112 www.linkedin.com/in/ashutosh-kumar-03b420124/
@raghavmittal7112
@raghavmittal7112 2 года назад
Bro i had send request from the name of sparsh . Please check it once and accept the request
@AshutoshKumaryt
@AshutoshKumaryt 2 года назад
@@raghavmittal7112 my pleasure
@user-qn5yf8bc1c
@user-qn5yf8bc1c 6 месяцев назад
hi brother i tried this method but im getting false output can you help me with my code?
@akshaybomdyal
@akshaybomdyal Год назад
Not working in SQL deployper also
@akshaybomdyal
@akshaybomdyal Год назад
Bro it is not working in toad application, what is the function datediff in toad
@AshutoshKumaryt
@AshutoshKumaryt Год назад
just check on google bro
@TalhaShakeelpak
@TalhaShakeelpak Год назад
Hi, how to convert this in time format? I'm using convert() function but it is not working.
@AshutoshKumaryt
@AshutoshKumaryt Год назад
You can try making something from scratch and apply the same logic
@arunkumar-mw9hm
@arunkumar-mw9hm Год назад
Hi Ashutosh
@arunkumar-mw9hm
@arunkumar-mw9hm Год назад
How we can extract time difference for for one Column. for example Timing1 has 3 records I need to calculate time difference then cumulative those values Can you please give your mobile number I can pay money for this requirement
@AshutoshKumaryt
@AshutoshKumaryt Год назад
just use lead function get the timestamp in the next column , then procedd same as above it becomes the same problem now
Далее
STRING AGG IN SQL | Advanced SQL | Ashutosh Kumar
29:33
Italians vs @BayashiTV_  SO CLOSE
00:30
Просмотров 2,4 млн
57. DATEDIFF Function in SQL
9:23
Просмотров 24 тыс.
CTE s IN SQL | Advanced SQL | Ashutosh Kumar
26:29
Просмотров 8 тыс.
SQL Views Tutorial | VIEWS in SQL Complete Tutorial
43:20
Stop using COUNT(id) to count rows
7:01
Просмотров 373 тыс.