filmov
tv
Shortest and longest length city | SQL Server |SQL Interview Preparation | Part 48
Показать описание
Shortest and longest length city in sql
Please share videos to all your friends
For SQL Quiz-
Find Us On FaceBook-
-----Query
IF EXISTS (SELECT 1 FROM SYS.TABLES WHERE NAME='STATION')
BEGIN
DROP TABLE STATION
END
CREATE TABLE STATION
(
ID INT,
CITY VARCHAR(21),
STATE VARCHAR(10),
LAT_N NUMERIC(14,8),
LONG_W NUMERIC(14,8)
)
INSERT STATION VALUES (1,'Noida','UP',1.025,2.365789),(2,'Kanpur','UP',5.36987,5.369874),
(2,'Unnao','UP',1.12567,6.354789),(4,'Pune','M',2.36548,3.012548),
(5,'NAGPUR','M',3.36548,5.012548),(6,'ROME','XX',7.36548,8.012548)
;with cte1
as
(
SELECT top 1 city,LEN(CITY) as len_city
FROM STATION
order by LEN(city),CITY
),cte2
as
(
select top 1 CITY,len(city) as len_city
from STATION
order by len(city) desc,CITY
)
select * from cte1
union all
select * from cte2
Please share videos to all your friends
For SQL Quiz-
Find Us On FaceBook-
-----Query
IF EXISTS (SELECT 1 FROM SYS.TABLES WHERE NAME='STATION')
BEGIN
DROP TABLE STATION
END
CREATE TABLE STATION
(
ID INT,
CITY VARCHAR(21),
STATE VARCHAR(10),
LAT_N NUMERIC(14,8),
LONG_W NUMERIC(14,8)
)
INSERT STATION VALUES (1,'Noida','UP',1.025,2.365789),(2,'Kanpur','UP',5.36987,5.369874),
(2,'Unnao','UP',1.12567,6.354789),(4,'Pune','M',2.36548,3.012548),
(5,'NAGPUR','M',3.36548,5.012548),(6,'ROME','XX',7.36548,8.012548)
;with cte1
as
(
SELECT top 1 city,LEN(CITY) as len_city
FROM STATION
order by LEN(city),CITY
),cte2
as
(
select top 1 CITY,len(city) as len_city
from STATION
order by len(city) desc,CITY
)
select * from cte1
union all
select * from cte2
SQL - Query cities w/ shortest and longest names with length!!!
Shortest and longest length city | SQL Server |SQL Interview Preparation | Part 48
HackerRank - Get shortest and longest city name using Sql Server.
SQL : Select shortest and longest string
Day 4|| SQL Queries to Filter Cities by Vowels | Shortest & Longest City Names | SQL Series
Tallest Man MEETS Shortest Woman 😮
SQL : SQL query for finding the longest name and shortest name in a table
World’s Shortest and Longest Flights - From 53 Seconds to 20 Hours!
What's the Longest Walk-able Distance on Earth?
Shortest Arcs in One Piece
The shortest and longest domestic flight from New York City #newyork #longestflight #jfkairport
Why the Smallest Piece of Land in NYC Exists
World's Shortest and Longest: A Journey of Extremes - LifehackerX
What is the longest and shortest flights #shorts
How the Movement of the Earth and Sun Cause the Days, Seasons and Years
Every Melbourne Metro train line from the shortest to the longest
What Are The World’s Shortest International Routes?
Shortest & Fastest Routes, Isochrone Maps, Time - Distance Matrix using QGIS
Don’t Get Comfortable: The World’s Shortest Ever Airbus A380 Routes
World's Shortest and Longest Journey - LifehackerX
The Place Where the Sun Never Sets
Calculating Shortest and Fastest Paths using QGIS (ORS Tools)
Which Passenger Planes Have The Shortest Takeoff Distance?
Shortest Home Run of All Time
Комментарии