select c1.*,c2.destination from ( select id,source from flight_info as f1 where source not in (select distinct destination from flight_info as f2 where f2.id = f1.id) ) as c1 join ( select id,destination from flight_info as f1 where destination not in (select distinct source from flight_info as f2 where f2.id = f1.id)) as c2 using(id)
Please guide me I am final year student I don't have any projects made , please tell what projects should Every fresher have to be in their for getting shortlisted
SELECT ID,MAX(TT),MAX(TR) FROM( SELECT ID,LAG(SOURCE)OVER(PARTITION BY ID ORDER BY ROWID)TT, LEAD(DESTINATION) OVER(PARTITION BY ID ORDER BY ROWID)TR FROM FLIGHT_INFO) GROUP BY ID ;
here is my solution SELECT DISTINCT id, FIRST_VALUE(source) OVER(partition by id order by id rows between unbounded preceding and unbounded following) as source, LAST_VALUE(destination) OVER(partition by id order by id rows between unbounded preceding and unbounded following) as destination FROM flight_info;
SELECT ID,MAX(TT),MAX(TR) FROM( SELECT ID,LAG(SOURCE)OVER(PARTITION BY ID ORDER BY ROWID)TT, LEAD(DESTINATION) OVER(PARTITION BY ID ORDER BY ROWID)TR FROM FLIGHT_INFO) GROUP BY ID ;
thank you for making this type of amazing videos.
Well done 👍
select c1.*,c2.destination
from
(
select id,source
from flight_info as f1
where source not in (select distinct destination from flight_info as f2 where f2.id = f1.id)
) as c1 join
(
select id,destination
from flight_info as f1
where destination not in (select distinct source from flight_info as f2 where f2.id = f1.id)) as c2
using(id)
good job
Please guide me I am final year student I don't have any projects made , please tell what projects should Every fresher have to be in their for getting shortlisted
focus on problem solving.
SELECT ID,MAX(TT),MAX(TR) FROM(
SELECT ID,LAG(SOURCE)OVER(PARTITION BY ID ORDER BY ROWID)TT,
LEAD(DESTINATION) OVER(PARTITION BY ID ORDER BY ROWID)TR FROM FLIGHT_INFO) GROUP BY ID ;
👍
here is my solution
SELECT
DISTINCT id,
FIRST_VALUE(source)
OVER(partition by id order by id rows between unbounded preceding and unbounded following) as source,
LAST_VALUE(destination)
OVER(partition by id order by id rows between unbounded preceding and unbounded following) as destination
FROM flight_info;
SELECT ID,MAX(TT),MAX(TR) FROM(
SELECT ID,LAG(SOURCE)OVER(PARTITION BY ID ORDER BY ROWID)TT,
LEAD(DESTINATION) OVER(PARTITION BY ID ORDER BY ROWID)TR FROM FLIGHT_INFO) GROUP BY ID ;
Nice buddy, try to solve using different different approaches.