SlideShare a Scribd company logo
Welcome 
MapInfo User Conference 2014: GIS Gets Personal 
#MapInfoUC
Hands on Lab 
13D Advanced SQL Selects 
Peter Horsbøll Møller 
GIS/LI Pre-Sales Specialist 
June 13, 2014 
Every connection is a new opportunity™ 
MapInfo User Conference 2014: GIS Gets Personal 
#MapInfoUC
MapInfo User Conference 2014: GIS Gets Personal 
#MapInfoUC 
Advanced 
SQL Selects 
Practice calculating 
distances, object lengths 
and other geographic 
operations in SQL. 
Learn how to use Sub-selects 
and other advanced 
features.
Geographic Measurements 
MapBasic functions 
• Area(OBJ, ”units”) 
• ObjectLen(OBJ, ”units”) 
• Perimeter(OBJ, ”units”) 
• They also exist as Cartesian- & Spherical- versions 
• Units: ”m” 
MapInfo User Conference 2014: GIS Gets Personal 
#MapInfoUC 
”km” 
”in” 
”ft” 
”mi” 
... 
”sq m” 
”sq km” 
”hectare” 
”sq ft” 
”sq mi” 
...
MapInfo User Conference 2014: GIS Gets Personal 
#MapInfoUC 
Exercise 
Data sets 
•USStates.tab 
•USUS_HIWay.tab 
•Calculate the area of each state 
•Calculate the perimeter of each state 
•Calculate the length of each highway
Aggregations and Grouping 
With the aggregations you can extract statistical 
information from a number of records, such as Sum, 
Average and Minimum or Maximum values 
The aggregations often take a column as parameter. 
Count(*), however, just takes a * 
If you use an aggregation you’ll get just one row in the 
result, unless you specify a column to group the result by 
MapInfo User Conference 2014: GIS Gets Personal 
#MapInfoUC
MapInfo User Conference 2014: GIS Gets Personal 
#MapInfoUC 
Exercise 
Data sets 
•USStates.tab 
•USUS_HIWay.tab 
•Calculate the total area of all states 
•Calculate the total area of the selected states 
•Calculate the total length of the selected highways
MapInfo User Conference 2014: GIS Gets Personal 
#MapInfoUC 
Joining Tables 
When joining two tables thru a Select statement you need 
to specify a join condition 
This can be a alfanumerical join: 
• TABLE1.ID = TABLE2.ID 
or a spatial join: 
• TABLE1.OBJ Intersects TABLE2.OBJ 
The spatial object is taken from the first table in the join 
statement
MapInfo User Conference 2014: GIS Gets Personal 
#MapInfoUC 
Exercise 
Data sets 
•USStates.tab 
•USUS_HIWay.tab 
•Find the spatial join between highways and states, that is 
which states does the highways intersect? 
•How much of each highway (in miles) is within the 
individual states?
MapInfo User Conference 2014: GIS Gets Personal 
#MapInfoUC 
Sub Selections 
A Sub Selection returns a value or a list of values that can 
compared to bojects or alfanumerical values 
A sub select has this structure: 
Select * From TABLE1 Where COLUMN1 
In (Select COLUMN1 From TABLE2) 
Or 
Select * From TABLE1 Where OBJ Intersects 
Any (Select OBJ From TABLE2)
MapInfo User Conference 2014: GIS Gets Personal 
#MapInfoUC 
Exercise 
Data sets 
•USStates.tab 
•USUS_HIWay.tab 
•Find the states that has one or more highways crossing 
•Find the states that has no highways crossing
Measuring Distance 
MapBasic functions 
• Distance(xFrom, yFrom, xTo, yTo, ”units”) 
• Exists also as Cartesian- & Spherical- versions 
• Format$() 
• Can be used to forse a larger number of decimals: 
Format$(numeric_value, ”#.######”) 
• CentroidX(object) / CentroidY(object) 
• Extracts coordinates from the centroid of an object 
MapInfo User Conference 2014: GIS Gets Personal 
#MapInfoUC
MapInfo User Conference 2014: GIS Gets Personal 
#MapInfoUC 
Exercise 
Data sets 
•USStates.tab 
•USUS_HIWay.tab 
•USSTATECAP.tab 
•Find the distance from every state capital to Washington 
•Find the distance from every state capital to Nashville
MapInfo User Conference 2014: GIS Gets Personal 
#MapInfoUC 
Solutions 
1 Select State_Name 
, Area(obj, "sq mi") "Area sq miles" 
from STATES into Selection 
2 Select State_Name 
, Area(obj, "sq mi") "Area sq miles" 
, Perimeter(obj, "mi") "Perimeter miles" 
from STATES into Selection 
3 Select Highway 
, ObjectLen(obj, "mi") “Length miles” 
from US_HIWAY into Selection 
4 Select Sum(Area(obj, "sq mi")) "Area sq miles" 
from STATES into Selection
MapInfo User Conference 2014: GIS Gets Personal 
#MapInfoUC 
Solutions 
5 Select Sum(Area(obj, "sq mi")) "Area sq miles" 
from Selection into __SUM 
6 Select Sum(ObjectLen(obj, "mi")) “Length miles” 
from Selection into __SUM 
7 Select US_HIWAY.Highway, STATES.State_Name 
from US_HIWAY, STATES 
where US_HIWAY.Obj Intersects STATES.Obj 
order by US_HIWAY.Highway, STATES.State_Name 
into Selection
MapInfo User Conference 2014: GIS Gets Personal 
#MapInfoUC 
Solutions 
8 Select US_HIWAY.Highway, STATES.State_Name 
, ObjectLen(Overlap(US_HIWAY.Obj, STATES.Obj), "mi") "Length Miles" 
from US_HIWAY, STATES 
where US_HIWAY.Obj Intersects STATES.Obj 
order by US_HIWAY.Highway, STATES.State_Name 
into Selection 
9 Select State_Name 
from STATES 
where OBJ Intersects Any (Select OBJ From US_HIWAY) 
order by State_Name 
into Selection
MapInfo User Conference 2014: GIS Gets Personal 
#MapInfoUC 
Solutions 
10 Select State_Name 
from STATES 
where not OBJ Intersects Any (Select OBJ From US_HIWAY) 
order by State_Name 
into Selection
MapInfo User Conference 2014: GIS Gets Personal 
#MapInfoUC 
Solutions 
11 Set CoordSys Table STATECAP 
‘Select Washinton 
Fetch First From Selection 
Print Format$(CentroidX(Selection.obj), "#.######") 
+ ", " + Format$(CentroidY(Selection.obj), "#.######") 
Select Capital, State 
, Distance(-77.016167, 38.90505, CentroidX(OBJ), CentroidY(OBJ), "mi") 
"Distance To Washington" 
from STATECAP into Selection
Get the latest 
MapInfo User Conference news: 
Twitter via #MapInfoUC 
and follow us @MapInfo 
MapInfo User Conference 2014: GIS Gets Personal 
#MapInfoUC

More Related Content

What's hot

Using Spectrum on Demand from MapInfo Pro
Using Spectrum on Demand from MapInfo ProUsing Spectrum on Demand from MapInfo Pro
Using Spectrum on Demand from MapInfo Pro
Peter Horsbøll Møller
 
GEOPROCESSING IN QGIS
GEOPROCESSING IN QGISGEOPROCESSING IN QGIS
GEOPROCESSING IN QGIS
Swetha A
 
Nycct GIS_primer tutorial
Nycct  GIS_primer tutorialNycct  GIS_primer tutorial
Nycct GIS_primer tutorial
NYCCTfab
 
QGIS Tutorial 1
QGIS Tutorial 1QGIS Tutorial 1
QGIS Tutorial 1
niloyghosh1984
 
QGIS Module 2
QGIS Module 2QGIS Module 2
QGIS Module 2
CAPSUCSF
 
QGIS training class 1
QGIS training class 1QGIS training class 1
QGIS training class 1
Hiroaki Sengoku
 
The strength of a spatial database
The strength of a spatial databaseThe strength of a spatial database
The strength of a spatial database
Peter Horsbøll Møller
 
QGIS Module 4
QGIS Module 4QGIS Module 4
QGIS Module 4
CAPSUCSF
 
Where2.0Now - Finding the heat in Thematic Maps
Where2.0Now - Finding the heat in Thematic MapsWhere2.0Now - Finding the heat in Thematic Maps
Where2.0Now - Finding the heat in Thematic Maps
John Fagan
 
QGIS Tutorial 2
QGIS Tutorial 2QGIS Tutorial 2
QGIS Tutorial 2
niloyghosh1984
 
MapInfo Discover 3D: From 2D to 3D
MapInfo Discover 3D: From 2D to 3DMapInfo Discover 3D: From 2D to 3D
MapInfo Discover 3D: From 2D to 3D
Peter Horsbøll Møller
 
All the New Cool Stuff in QGIS 2.0
All the New Cool Stuff in QGIS 2.0All the New Cool Stuff in QGIS 2.0
All the New Cool Stuff in QGIS 2.0
Nathan Woodrow
 
Introduction to Tools in ArcGIS
Introduction to Tools in ArcGISIntroduction to Tools in ArcGIS
Introduction to Tools in ArcGIS
Daniele Baker
 
Arc catalog introduction
Arc catalog introductionArc catalog introduction
Arc catalog introduction
Ashok Peddi
 
MapInfo Professional 12.5 and Discover3D 2014 - A brief overview
MapInfo Professional 12.5 and Discover3D 2014 - A brief overviewMapInfo Professional 12.5 and Discover3D 2014 - A brief overview
MapInfo Professional 12.5 and Discover3D 2014 - A brief overview
Prakher Hajela Saxena
 
QGIS Module 3
QGIS Module 3QGIS Module 3
QGIS Module 3
CAPSUCSF
 
Hive query optimization infinity
Hive query optimization infinityHive query optimization infinity
Hive query optimization infinity
Shashwat Shriparv
 
Spot db consistency checking and optimization in spatial database
Spot db  consistency checking and optimization in spatial databaseSpot db  consistency checking and optimization in spatial database
Spot db consistency checking and optimization in spatial database
Pratik Udapure
 
Spatial query tutorial for nyc subway income level along subway
Spatial query tutorial  for nyc subway income level along subwaySpatial query tutorial  for nyc subway income level along subway
Spatial query tutorial for nyc subway income level along subway
Vivian S. Zhang
 

What's hot (20)

Using Spectrum on Demand from MapInfo Pro
Using Spectrum on Demand from MapInfo ProUsing Spectrum on Demand from MapInfo Pro
Using Spectrum on Demand from MapInfo Pro
 
GEOPROCESSING IN QGIS
GEOPROCESSING IN QGISGEOPROCESSING IN QGIS
GEOPROCESSING IN QGIS
 
Nycct GIS_primer tutorial
Nycct  GIS_primer tutorialNycct  GIS_primer tutorial
Nycct GIS_primer tutorial
 
QGIS Tutorial 1
QGIS Tutorial 1QGIS Tutorial 1
QGIS Tutorial 1
 
QGIS Module 2
QGIS Module 2QGIS Module 2
QGIS Module 2
 
QGIS training class 1
QGIS training class 1QGIS training class 1
QGIS training class 1
 
The strength of a spatial database
The strength of a spatial databaseThe strength of a spatial database
The strength of a spatial database
 
QGIS Module 4
QGIS Module 4QGIS Module 4
QGIS Module 4
 
Where2.0Now - Finding the heat in Thematic Maps
Where2.0Now - Finding the heat in Thematic MapsWhere2.0Now - Finding the heat in Thematic Maps
Where2.0Now - Finding the heat in Thematic Maps
 
QGIS Tutorial 2
QGIS Tutorial 2QGIS Tutorial 2
QGIS Tutorial 2
 
MapInfo Discover 3D: From 2D to 3D
MapInfo Discover 3D: From 2D to 3DMapInfo Discover 3D: From 2D to 3D
MapInfo Discover 3D: From 2D to 3D
 
All the New Cool Stuff in QGIS 2.0
All the New Cool Stuff in QGIS 2.0All the New Cool Stuff in QGIS 2.0
All the New Cool Stuff in QGIS 2.0
 
Introduction to Tools in ArcGIS
Introduction to Tools in ArcGISIntroduction to Tools in ArcGIS
Introduction to Tools in ArcGIS
 
Arc catalog introduction
Arc catalog introductionArc catalog introduction
Arc catalog introduction
 
MapInfo Professional 12.5 and Discover3D 2014 - A brief overview
MapInfo Professional 12.5 and Discover3D 2014 - A brief overviewMapInfo Professional 12.5 and Discover3D 2014 - A brief overview
MapInfo Professional 12.5 and Discover3D 2014 - A brief overview
 
QGIS Module 3
QGIS Module 3QGIS Module 3
QGIS Module 3
 
Hive query optimization infinity
Hive query optimization infinityHive query optimization infinity
Hive query optimization infinity
 
Spot db consistency checking and optimization in spatial database
Spot db  consistency checking and optimization in spatial databaseSpot db  consistency checking and optimization in spatial database
Spot db consistency checking and optimization in spatial database
 
QGIS training
QGIS trainingQGIS training
QGIS training
 
Spatial query tutorial for nyc subway income level along subway
Spatial query tutorial  for nyc subway income level along subwaySpatial query tutorial  for nyc subway income level along subway
Spatial query tutorial for nyc subway income level along subway
 

Similar to Advanced SQL Selects

Concepts and Methods of Embedding Statistical Data into Maps
Concepts and Methods of Embedding Statistical Data into MapsConcepts and Methods of Embedding Statistical Data into Maps
Concepts and Methods of Embedding Statistical Data into Maps
Mohammad Liton Hossain
 
Data sources and input in GIS
Data  sources and input in GISData  sources and input in GIS
Data sources and input in GIS
Prof. A.Balasubramanian
 
Geographic information system
Geographic information systemGeographic information system
Geographic information system
Kamrul Islam Karim
 
GIS PPT
GIS PPTGIS PPT
GIS
GISGIS
iTimer - Count On Your Time
iTimer - Count On Your TimeiTimer - Count On Your Time
iTimer - Count On Your Time
rahulmonikasharma
 
THE NATURE AND SOURCE OF GEOGRAPHIC DATA
THE NATURE AND SOURCE OF GEOGRAPHIC DATATHE NATURE AND SOURCE OF GEOGRAPHIC DATA
THE NATURE AND SOURCE OF GEOGRAPHIC DATA
Nadia Aziz
 
Using geobrowsers for thematic mapping
Using geobrowsers for thematic mappingUsing geobrowsers for thematic mapping
Using geobrowsers for thematic mapping
Bjorn Sandvik
 
QGIS training class 3
QGIS training class 3QGIS training class 3
QGIS training class 3
Hiroaki Sengoku
 
Lecture_1.ppt netwok and security system by mr desu
Lecture_1.ppt netwok and security system by mr desuLecture_1.ppt netwok and security system by mr desu
Lecture_1.ppt netwok and security system by mr desu
desalewminale
 
The Sum of our Parts: the Complete CARTO Journey [CARTO]
The Sum of our Parts: the Complete CARTO Journey [CARTO]The Sum of our Parts: the Complete CARTO Journey [CARTO]
The Sum of our Parts: the Complete CARTO Journey [CARTO]
CARTO
 
GIS@NIH
GIS@NIHGIS@NIH
What is Geography Information Systems (GIS)
What is Geography Information Systems (GIS)What is Geography Information Systems (GIS)
What is Geography Information Systems (GIS)
John Lanser
 
Intro GIS.pptx
Intro GIS.pptxIntro GIS.pptx
Intro GIS.pptx
SamiDan2
 
Introduction_to_QGIS_Revision, read before
Introduction_to_QGIS_Revision, read beforeIntroduction_to_QGIS_Revision, read before
Introduction_to_QGIS_Revision, read before
MadhuSudhan725843
 
Sql server 2008 r2 spatial data whitepaper
Sql server 2008 r2 spatial data whitepaperSql server 2008 r2 spatial data whitepaper
Sql server 2008 r2 spatial data whitepaperKlaudiia Jacome
 

Similar to Advanced SQL Selects (20)

Concepts and Methods of Embedding Statistical Data into Maps
Concepts and Methods of Embedding Statistical Data into MapsConcepts and Methods of Embedding Statistical Data into Maps
Concepts and Methods of Embedding Statistical Data into Maps
 
Data sources and input in GIS
Data  sources and input in GISData  sources and input in GIS
Data sources and input in GIS
 
Geographic information system
Geographic information systemGeographic information system
Geographic information system
 
project
projectproject
project
 
project
projectproject
project
 
GIS PPT
GIS PPTGIS PPT
GIS PPT
 
GIS
GISGIS
GIS
 
iTimer - Count On Your Time
iTimer - Count On Your TimeiTimer - Count On Your Time
iTimer - Count On Your Time
 
THE NATURE AND SOURCE OF GEOGRAPHIC DATA
THE NATURE AND SOURCE OF GEOGRAPHIC DATATHE NATURE AND SOURCE OF GEOGRAPHIC DATA
THE NATURE AND SOURCE OF GEOGRAPHIC DATA
 
Using geobrowsers for thematic mapping
Using geobrowsers for thematic mappingUsing geobrowsers for thematic mapping
Using geobrowsers for thematic mapping
 
Mapinfo 2014
Mapinfo 2014Mapinfo 2014
Mapinfo 2014
 
QGIS training class 3
QGIS training class 3QGIS training class 3
QGIS training class 3
 
Lecture_1.ppt netwok and security system by mr desu
Lecture_1.ppt netwok and security system by mr desuLecture_1.ppt netwok and security system by mr desu
Lecture_1.ppt netwok and security system by mr desu
 
Maricopa County Elections & GIS at GeekNet11
Maricopa County Elections & GIS at GeekNet11Maricopa County Elections & GIS at GeekNet11
Maricopa County Elections & GIS at GeekNet11
 
The Sum of our Parts: the Complete CARTO Journey [CARTO]
The Sum of our Parts: the Complete CARTO Journey [CARTO]The Sum of our Parts: the Complete CARTO Journey [CARTO]
The Sum of our Parts: the Complete CARTO Journey [CARTO]
 
GIS@NIH
GIS@NIHGIS@NIH
GIS@NIH
 
What is Geography Information Systems (GIS)
What is Geography Information Systems (GIS)What is Geography Information Systems (GIS)
What is Geography Information Systems (GIS)
 
Intro GIS.pptx
Intro GIS.pptxIntro GIS.pptx
Intro GIS.pptx
 
Introduction_to_QGIS_Revision, read before
Introduction_to_QGIS_Revision, read beforeIntroduction_to_QGIS_Revision, read before
Introduction_to_QGIS_Revision, read before
 
Sql server 2008 r2 spatial data whitepaper
Sql server 2008 r2 spatial data whitepaperSql server 2008 r2 spatial data whitepaper
Sql server 2008 r2 spatial data whitepaper
 

More from Peter Horsbøll Møller

MapInfo Pro v12.5 to v2021.1 Overview
MapInfo Pro v12.5 to v2021.1 OverviewMapInfo Pro v12.5 to v2021.1 Overview
MapInfo Pro v12.5 to v2021.1 Overview
Peter Horsbøll Møller
 
MapInfo Pro Tips & Tricks med Geograf
MapInfo Pro Tips & Tricks med GeografMapInfo Pro Tips & Tricks med Geograf
MapInfo Pro Tips & Tricks med Geograf
Peter Horsbøll Møller
 
Introduction to MapBasic
Introduction to MapBasicIntroduction to MapBasic
Introduction to MapBasic
Peter Horsbøll Møller
 
Eksklusivsmagning - 10 års jubilæum, Oksenvad Whiskylaug
Eksklusivsmagning - 10 års jubilæum, Oksenvad WhiskylaugEksklusivsmagning - 10 års jubilæum, Oksenvad Whiskylaug
Eksklusivsmagning - 10 års jubilæum, Oksenvad Whiskylaug
Peter Horsbøll Møller
 
Llinking Spectrum dataflows to MapInfo Pro
Llinking Spectrum dataflows to MapInfo ProLlinking Spectrum dataflows to MapInfo Pro
Llinking Spectrum dataflows to MapInfo Pro
Peter Horsbøll Møller
 
Clynelish - Oksenvad Whiskylaug
Clynelish - Oksenvad WhiskylaugClynelish - Oksenvad Whiskylaug
Clynelish - Oksenvad Whiskylaug
Peter Horsbøll Møller
 
Getting Started with the Ribbon library - MUGUKI User Group Meeting 2016
Getting Started with the Ribbon library - MUGUKI User Group Meeting 2016Getting Started with the Ribbon library - MUGUKI User Group Meeting 2016
Getting Started with the Ribbon library - MUGUKI User Group Meeting 2016
Peter Horsbøll Møller
 
Whiskysmagning: Samaroli
Whiskysmagning: SamaroliWhiskysmagning: Samaroli
Whiskysmagning: Samaroli
Peter Horsbøll Møller
 
Hvad sker der hos Pitney Bowes
Hvad sker der hos Pitney BowesHvad sker der hos Pitney Bowes
Hvad sker der hos Pitney Bowes
Peter Horsbøll Møller
 
MapInfo Discover 2015.2 64 bit
MapInfo Discover 2015.2 64 bitMapInfo Discover 2015.2 64 bit
MapInfo Discover 2015.2 64 bit
Peter Horsbøll Møller
 
MapInfo Pro 64 bit og MapInfo Pro Advanced 64 bit
MapInfo Pro 64 bit og MapInfo Pro Advanced 64 bitMapInfo Pro 64 bit og MapInfo Pro Advanced 64 bit
MapInfo Pro 64 bit og MapInfo Pro Advanced 64 bit
Peter Horsbøll Møller
 
MapInfo Pro Raster og de danske højdedata
MapInfo Pro Raster og de danske højdedataMapInfo Pro Raster og de danske højdedata
MapInfo Pro Raster og de danske højdedata
Peter Horsbøll Møller
 
64 bits of MapInfo Pro - Danish version
64 bits of MapInfo Pro - Danish version64 bits of MapInfo Pro - Danish version
64 bits of MapInfo Pro - Danish version
Peter Horsbøll Møller
 
Blend, Single Grain og Single Malt Whisky
Blend, Single Grain og Single Malt WhiskyBlend, Single Grain og Single Malt Whisky
Blend, Single Grain og Single Malt Whisky
Peter Horsbøll Møller
 
MapInfo Pro og SQL Server - Uden opgaver
MapInfo Pro og SQL Server - Uden opgaverMapInfo Pro og SQL Server - Uden opgaver
MapInfo Pro og SQL Server - Uden opgaver
Peter Horsbøll Møller
 
Nyheder i MapInfo Pro 12.5 Dansk 32 bit
Nyheder i MapInfo Pro 12.5 Dansk 32 bitNyheder i MapInfo Pro 12.5 Dansk 32 bit
Nyheder i MapInfo Pro 12.5 Dansk 32 bit
Peter Horsbøll Møller
 
The Macallan - Oksenvad Whiskylaug
The Macallan - Oksenvad WhiskylaugThe Macallan - Oksenvad Whiskylaug
The Macallan - Oksenvad Whiskylaug
Peter Horsbøll Møller
 
WMS, WFS og alle deres venner
WMS, WFS og alle deres vennerWMS, WFS og alle deres venner
WMS, WFS og alle deres venner
Peter Horsbøll Møller
 
Hvad påvirker en whisky
Hvad påvirker en whiskyHvad påvirker en whisky
Hvad påvirker en whisky
Peter Horsbøll Møller
 
Using MapBasic to modify your user interface
Using MapBasic to modify your user interfaceUsing MapBasic to modify your user interface
Using MapBasic to modify your user interface
Peter Horsbøll Møller
 

More from Peter Horsbøll Møller (20)

MapInfo Pro v12.5 to v2021.1 Overview
MapInfo Pro v12.5 to v2021.1 OverviewMapInfo Pro v12.5 to v2021.1 Overview
MapInfo Pro v12.5 to v2021.1 Overview
 
MapInfo Pro Tips & Tricks med Geograf
MapInfo Pro Tips & Tricks med GeografMapInfo Pro Tips & Tricks med Geograf
MapInfo Pro Tips & Tricks med Geograf
 
Introduction to MapBasic
Introduction to MapBasicIntroduction to MapBasic
Introduction to MapBasic
 
Eksklusivsmagning - 10 års jubilæum, Oksenvad Whiskylaug
Eksklusivsmagning - 10 års jubilæum, Oksenvad WhiskylaugEksklusivsmagning - 10 års jubilæum, Oksenvad Whiskylaug
Eksklusivsmagning - 10 års jubilæum, Oksenvad Whiskylaug
 
Llinking Spectrum dataflows to MapInfo Pro
Llinking Spectrum dataflows to MapInfo ProLlinking Spectrum dataflows to MapInfo Pro
Llinking Spectrum dataflows to MapInfo Pro
 
Clynelish - Oksenvad Whiskylaug
Clynelish - Oksenvad WhiskylaugClynelish - Oksenvad Whiskylaug
Clynelish - Oksenvad Whiskylaug
 
Getting Started with the Ribbon library - MUGUKI User Group Meeting 2016
Getting Started with the Ribbon library - MUGUKI User Group Meeting 2016Getting Started with the Ribbon library - MUGUKI User Group Meeting 2016
Getting Started with the Ribbon library - MUGUKI User Group Meeting 2016
 
Whiskysmagning: Samaroli
Whiskysmagning: SamaroliWhiskysmagning: Samaroli
Whiskysmagning: Samaroli
 
Hvad sker der hos Pitney Bowes
Hvad sker der hos Pitney BowesHvad sker der hos Pitney Bowes
Hvad sker der hos Pitney Bowes
 
MapInfo Discover 2015.2 64 bit
MapInfo Discover 2015.2 64 bitMapInfo Discover 2015.2 64 bit
MapInfo Discover 2015.2 64 bit
 
MapInfo Pro 64 bit og MapInfo Pro Advanced 64 bit
MapInfo Pro 64 bit og MapInfo Pro Advanced 64 bitMapInfo Pro 64 bit og MapInfo Pro Advanced 64 bit
MapInfo Pro 64 bit og MapInfo Pro Advanced 64 bit
 
MapInfo Pro Raster og de danske højdedata
MapInfo Pro Raster og de danske højdedataMapInfo Pro Raster og de danske højdedata
MapInfo Pro Raster og de danske højdedata
 
64 bits of MapInfo Pro - Danish version
64 bits of MapInfo Pro - Danish version64 bits of MapInfo Pro - Danish version
64 bits of MapInfo Pro - Danish version
 
Blend, Single Grain og Single Malt Whisky
Blend, Single Grain og Single Malt WhiskyBlend, Single Grain og Single Malt Whisky
Blend, Single Grain og Single Malt Whisky
 
MapInfo Pro og SQL Server - Uden opgaver
MapInfo Pro og SQL Server - Uden opgaverMapInfo Pro og SQL Server - Uden opgaver
MapInfo Pro og SQL Server - Uden opgaver
 
Nyheder i MapInfo Pro 12.5 Dansk 32 bit
Nyheder i MapInfo Pro 12.5 Dansk 32 bitNyheder i MapInfo Pro 12.5 Dansk 32 bit
Nyheder i MapInfo Pro 12.5 Dansk 32 bit
 
The Macallan - Oksenvad Whiskylaug
The Macallan - Oksenvad WhiskylaugThe Macallan - Oksenvad Whiskylaug
The Macallan - Oksenvad Whiskylaug
 
WMS, WFS og alle deres venner
WMS, WFS og alle deres vennerWMS, WFS og alle deres venner
WMS, WFS og alle deres venner
 
Hvad påvirker en whisky
Hvad påvirker en whiskyHvad påvirker en whisky
Hvad påvirker en whisky
 
Using MapBasic to modify your user interface
Using MapBasic to modify your user interfaceUsing MapBasic to modify your user interface
Using MapBasic to modify your user interface
 

Recently uploaded

JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 

Recently uploaded (20)

JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 

Advanced SQL Selects

  • 1. Welcome MapInfo User Conference 2014: GIS Gets Personal #MapInfoUC
  • 2. Hands on Lab 13D Advanced SQL Selects Peter Horsbøll Møller GIS/LI Pre-Sales Specialist June 13, 2014 Every connection is a new opportunity™ MapInfo User Conference 2014: GIS Gets Personal #MapInfoUC
  • 3. MapInfo User Conference 2014: GIS Gets Personal #MapInfoUC Advanced SQL Selects Practice calculating distances, object lengths and other geographic operations in SQL. Learn how to use Sub-selects and other advanced features.
  • 4. Geographic Measurements MapBasic functions • Area(OBJ, ”units”) • ObjectLen(OBJ, ”units”) • Perimeter(OBJ, ”units”) • They also exist as Cartesian- & Spherical- versions • Units: ”m” MapInfo User Conference 2014: GIS Gets Personal #MapInfoUC ”km” ”in” ”ft” ”mi” ... ”sq m” ”sq km” ”hectare” ”sq ft” ”sq mi” ...
  • 5. MapInfo User Conference 2014: GIS Gets Personal #MapInfoUC Exercise Data sets •USStates.tab •USUS_HIWay.tab •Calculate the area of each state •Calculate the perimeter of each state •Calculate the length of each highway
  • 6. Aggregations and Grouping With the aggregations you can extract statistical information from a number of records, such as Sum, Average and Minimum or Maximum values The aggregations often take a column as parameter. Count(*), however, just takes a * If you use an aggregation you’ll get just one row in the result, unless you specify a column to group the result by MapInfo User Conference 2014: GIS Gets Personal #MapInfoUC
  • 7. MapInfo User Conference 2014: GIS Gets Personal #MapInfoUC Exercise Data sets •USStates.tab •USUS_HIWay.tab •Calculate the total area of all states •Calculate the total area of the selected states •Calculate the total length of the selected highways
  • 8. MapInfo User Conference 2014: GIS Gets Personal #MapInfoUC Joining Tables When joining two tables thru a Select statement you need to specify a join condition This can be a alfanumerical join: • TABLE1.ID = TABLE2.ID or a spatial join: • TABLE1.OBJ Intersects TABLE2.OBJ The spatial object is taken from the first table in the join statement
  • 9. MapInfo User Conference 2014: GIS Gets Personal #MapInfoUC Exercise Data sets •USStates.tab •USUS_HIWay.tab •Find the spatial join between highways and states, that is which states does the highways intersect? •How much of each highway (in miles) is within the individual states?
  • 10. MapInfo User Conference 2014: GIS Gets Personal #MapInfoUC Sub Selections A Sub Selection returns a value or a list of values that can compared to bojects or alfanumerical values A sub select has this structure: Select * From TABLE1 Where COLUMN1 In (Select COLUMN1 From TABLE2) Or Select * From TABLE1 Where OBJ Intersects Any (Select OBJ From TABLE2)
  • 11. MapInfo User Conference 2014: GIS Gets Personal #MapInfoUC Exercise Data sets •USStates.tab •USUS_HIWay.tab •Find the states that has one or more highways crossing •Find the states that has no highways crossing
  • 12. Measuring Distance MapBasic functions • Distance(xFrom, yFrom, xTo, yTo, ”units”) • Exists also as Cartesian- & Spherical- versions • Format$() • Can be used to forse a larger number of decimals: Format$(numeric_value, ”#.######”) • CentroidX(object) / CentroidY(object) • Extracts coordinates from the centroid of an object MapInfo User Conference 2014: GIS Gets Personal #MapInfoUC
  • 13. MapInfo User Conference 2014: GIS Gets Personal #MapInfoUC Exercise Data sets •USStates.tab •USUS_HIWay.tab •USSTATECAP.tab •Find the distance from every state capital to Washington •Find the distance from every state capital to Nashville
  • 14. MapInfo User Conference 2014: GIS Gets Personal #MapInfoUC Solutions 1 Select State_Name , Area(obj, "sq mi") "Area sq miles" from STATES into Selection 2 Select State_Name , Area(obj, "sq mi") "Area sq miles" , Perimeter(obj, "mi") "Perimeter miles" from STATES into Selection 3 Select Highway , ObjectLen(obj, "mi") “Length miles” from US_HIWAY into Selection 4 Select Sum(Area(obj, "sq mi")) "Area sq miles" from STATES into Selection
  • 15. MapInfo User Conference 2014: GIS Gets Personal #MapInfoUC Solutions 5 Select Sum(Area(obj, "sq mi")) "Area sq miles" from Selection into __SUM 6 Select Sum(ObjectLen(obj, "mi")) “Length miles” from Selection into __SUM 7 Select US_HIWAY.Highway, STATES.State_Name from US_HIWAY, STATES where US_HIWAY.Obj Intersects STATES.Obj order by US_HIWAY.Highway, STATES.State_Name into Selection
  • 16. MapInfo User Conference 2014: GIS Gets Personal #MapInfoUC Solutions 8 Select US_HIWAY.Highway, STATES.State_Name , ObjectLen(Overlap(US_HIWAY.Obj, STATES.Obj), "mi") "Length Miles" from US_HIWAY, STATES where US_HIWAY.Obj Intersects STATES.Obj order by US_HIWAY.Highway, STATES.State_Name into Selection 9 Select State_Name from STATES where OBJ Intersects Any (Select OBJ From US_HIWAY) order by State_Name into Selection
  • 17. MapInfo User Conference 2014: GIS Gets Personal #MapInfoUC Solutions 10 Select State_Name from STATES where not OBJ Intersects Any (Select OBJ From US_HIWAY) order by State_Name into Selection
  • 18. MapInfo User Conference 2014: GIS Gets Personal #MapInfoUC Solutions 11 Set CoordSys Table STATECAP ‘Select Washinton Fetch First From Selection Print Format$(CentroidX(Selection.obj), "#.######") + ", " + Format$(CentroidY(Selection.obj), "#.######") Select Capital, State , Distance(-77.016167, 38.90505, CentroidX(OBJ), CentroidY(OBJ), "mi") "Distance To Washington" from STATECAP into Selection
  • 19. Get the latest MapInfo User Conference news: Twitter via #MapInfoUC and follow us @MapInfo MapInfo User Conference 2014: GIS Gets Personal #MapInfoUC