What is the syntax for adding a query to a spatial view from a related table in ArcGIS?What is spatial query...

What is the intuition behind short exact sequences of groups; in particular, what is the intuition behind group extensions?

Can a virus destroy the BIOS of a modern computer?

Infinite Abelian subgroup of infinite non Abelian group example

If human space travel is limited by the G force vulnerability, is there a way to counter G forces?

Why is consensus so controversial in Britain?

prove that the matrix A is diagonalizable

Were any external disk drives stacked vertically?

Why "Having chlorophyll without photosynthesis is actually very dangerous" and "like living with a bomb"?

How to show the equivalence between the regularized regression and their constraint formulas using KKT

What mechanic is there to disable a threat instead of killing it?

Increase size of symbol intercal when in superscript position

Why does Kotter return in Welcome Back Kotter

Why does Arabsat 6A need a Falcon Heavy to launch

Did Shadowfax go to Valinor?

Why 'in' operator is throwing error instead of logging false with string literal

Stopping power of mountain vs road bike

What is going on with Captain Marvel's blood colour?

Can I make "comment-region" comment empty lines?

Is it inappropriate for a student to attend their mentor's dissertation defense?

Watching something be written to a file live with tail

Does casting Light, or a similar spell, have any effect when the caster is swallowed by a monster?

How do I write bicross product symbols in latex?

What exploit are these user agents trying to use?

Reserved de-dupe rules



What is the syntax for adding a query to a spatial view from a related table in ArcGIS?


What is spatial query tool for laymen?What is the MS SQL Spatial syntax for counting points within polygons?Adding Oracle Spatial View as Layer in QGIS?Syntax to view permissions on Oracle tableLimitations of iterate row selection in ArcGIS ModelBuilder?Writing table view to disk (ArcGIS)Performing Definition Query Based on Related Table?Writing SQL Query to create spatial view?Better approach for selecting related records in multiple featureclasses based on query of related table? (sde/SQL server)Spatialite KNN view in QGIS






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







1















I'm just learning SQL so apologies for the poorly worded question. I'm basically trying to create a spatial view of hydrants that have been painted in 2018. I have a hydrant feature class (wHydrant) and a hydrant maintenance table (wHydrant_Maint). They are related by a common ID, although the names of the fields that contain the common ID are different. Here are my first few lines that I can get to return a view of all my hydrants with maintenance records:



SELECT h.OBJECTID, h.FACILITYID, h.SHAPE

FROM wHydrant h

JOIN wHydrant_Maint r

ON h.FACILITYID = r.Hydrant_ID


My issue (well, my issue is that I don’t know or use SQL…) is that I don’t know how to start the next part of the statement. I can do it using the definition query builder, no problem! But creating the proper statement is alluding me. I’m essentially trying to say: wHydrant_Maint.MAINT_ACTIVITY = 'Paint' and MaintDate > '2018’. I thought I could just tack on a WHERE statement, but I think because it’s pulling from the related table that maybe there is additional syntax. Any help would be appreciated. I'm using ArcGIS 10.5.1 and a SQL Server Enterprise database.










share|improve this question

























  • You can just "tack on a WHERE statement" as you say. Just make sure you refer to the table that holds the information you require, so if the field is in "wHydrant_Maint" you'd use WHERE r.MaintDate > 2018, as you've already specified r as being that table. You can look in both tables in your WHERE statement just by prefixing the h or r as needed for each field. Same in the SELECT statement

    – Midavalo
    6 mins ago


















1















I'm just learning SQL so apologies for the poorly worded question. I'm basically trying to create a spatial view of hydrants that have been painted in 2018. I have a hydrant feature class (wHydrant) and a hydrant maintenance table (wHydrant_Maint). They are related by a common ID, although the names of the fields that contain the common ID are different. Here are my first few lines that I can get to return a view of all my hydrants with maintenance records:



SELECT h.OBJECTID, h.FACILITYID, h.SHAPE

FROM wHydrant h

JOIN wHydrant_Maint r

ON h.FACILITYID = r.Hydrant_ID


My issue (well, my issue is that I don’t know or use SQL…) is that I don’t know how to start the next part of the statement. I can do it using the definition query builder, no problem! But creating the proper statement is alluding me. I’m essentially trying to say: wHydrant_Maint.MAINT_ACTIVITY = 'Paint' and MaintDate > '2018’. I thought I could just tack on a WHERE statement, but I think because it’s pulling from the related table that maybe there is additional syntax. Any help would be appreciated. I'm using ArcGIS 10.5.1 and a SQL Server Enterprise database.










share|improve this question

























  • You can just "tack on a WHERE statement" as you say. Just make sure you refer to the table that holds the information you require, so if the field is in "wHydrant_Maint" you'd use WHERE r.MaintDate > 2018, as you've already specified r as being that table. You can look in both tables in your WHERE statement just by prefixing the h or r as needed for each field. Same in the SELECT statement

    – Midavalo
    6 mins ago














1












1








1








I'm just learning SQL so apologies for the poorly worded question. I'm basically trying to create a spatial view of hydrants that have been painted in 2018. I have a hydrant feature class (wHydrant) and a hydrant maintenance table (wHydrant_Maint). They are related by a common ID, although the names of the fields that contain the common ID are different. Here are my first few lines that I can get to return a view of all my hydrants with maintenance records:



SELECT h.OBJECTID, h.FACILITYID, h.SHAPE

FROM wHydrant h

JOIN wHydrant_Maint r

ON h.FACILITYID = r.Hydrant_ID


My issue (well, my issue is that I don’t know or use SQL…) is that I don’t know how to start the next part of the statement. I can do it using the definition query builder, no problem! But creating the proper statement is alluding me. I’m essentially trying to say: wHydrant_Maint.MAINT_ACTIVITY = 'Paint' and MaintDate > '2018’. I thought I could just tack on a WHERE statement, but I think because it’s pulling from the related table that maybe there is additional syntax. Any help would be appreciated. I'm using ArcGIS 10.5.1 and a SQL Server Enterprise database.










share|improve this question
















I'm just learning SQL so apologies for the poorly worded question. I'm basically trying to create a spatial view of hydrants that have been painted in 2018. I have a hydrant feature class (wHydrant) and a hydrant maintenance table (wHydrant_Maint). They are related by a common ID, although the names of the fields that contain the common ID are different. Here are my first few lines that I can get to return a view of all my hydrants with maintenance records:



SELECT h.OBJECTID, h.FACILITYID, h.SHAPE

FROM wHydrant h

JOIN wHydrant_Maint r

ON h.FACILITYID = r.Hydrant_ID


My issue (well, my issue is that I don’t know or use SQL…) is that I don’t know how to start the next part of the statement. I can do it using the definition query builder, no problem! But creating the proper statement is alluding me. I’m essentially trying to say: wHydrant_Maint.MAINT_ACTIVITY = 'Paint' and MaintDate > '2018’. I thought I could just tack on a WHERE statement, but I think because it’s pulling from the related table that maybe there is additional syntax. Any help would be appreciated. I'm using ArcGIS 10.5.1 and a SQL Server Enterprise database.







arcgis-desktop sql spatial-view






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 9 mins ago









Midavalo

25.7k53274




25.7k53274










asked 10 mins ago









NadarNadar

62




62













  • You can just "tack on a WHERE statement" as you say. Just make sure you refer to the table that holds the information you require, so if the field is in "wHydrant_Maint" you'd use WHERE r.MaintDate > 2018, as you've already specified r as being that table. You can look in both tables in your WHERE statement just by prefixing the h or r as needed for each field. Same in the SELECT statement

    – Midavalo
    6 mins ago



















  • You can just "tack on a WHERE statement" as you say. Just make sure you refer to the table that holds the information you require, so if the field is in "wHydrant_Maint" you'd use WHERE r.MaintDate > 2018, as you've already specified r as being that table. You can look in both tables in your WHERE statement just by prefixing the h or r as needed for each field. Same in the SELECT statement

    – Midavalo
    6 mins ago

















You can just "tack on a WHERE statement" as you say. Just make sure you refer to the table that holds the information you require, so if the field is in "wHydrant_Maint" you'd use WHERE r.MaintDate > 2018, as you've already specified r as being that table. You can look in both tables in your WHERE statement just by prefixing the h or r as needed for each field. Same in the SELECT statement

– Midavalo
6 mins ago





You can just "tack on a WHERE statement" as you say. Just make sure you refer to the table that holds the information you require, so if the field is in "wHydrant_Maint" you'd use WHERE r.MaintDate > 2018, as you've already specified r as being that table. You can look in both tables in your WHERE statement just by prefixing the h or r as needed for each field. Same in the SELECT statement

– Midavalo
6 mins ago










0






active

oldest

votes












Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "79"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f317836%2fwhat-is-the-syntax-for-adding-a-query-to-a-spatial-view-from-a-related-table-in%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Geographic Information Systems Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f317836%2fwhat-is-the-syntax-for-adding-a-query-to-a-spatial-view-from-a-related-table-in%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

(145452) 2005 RN43 Классификация | Примечания | Ссылки |...

Щит и меч (фильм) Содержание Названия серий | Сюжет |...

Энтрерриос (город) Содержание История | Географическое...