zoukankan      html  css  js  c++  java
  • 【AE】多表的联合查询

    多表的联合查询

    // Create the query definition.
    IQueryDef queryDef = featureWorkspace.CreateQueryDef();
    
    // Provide a list of tables to join.
    queryDef.Tables = "streets, altname";
    
    // Set the subfields and the WhereClause (in this case, the join condition).
    queryDef.SubFields = "streets.NAME, streets.TYPE, altname.ST_NAME, altname.ST_TYPE";
    queryDef.WhereClause = "streets.OBJECTID = altname.JOINID";
    
    // Get a cursor of the results and find the indexes of the fields to display.
    using(ComReleaser comReleaser = new ComReleaser())
    {
        ICursor cursor = queryDef.Evaluate();
        comReleaser.ManageLifetime(cursor);
        int streetsNameIndex = cursor.FindField("streets.NAME");
        int streetsTypeIndex = cursor.FindField("streets.TYPE");
        int altnameNameIndex = cursor.FindField("altname.ST_NAME");
        int altnameTypeIndex = cursor.FindField("altname.ST_TYPE");
    
        // Use the cursor to step through the results, displaying the names and altnames of each 
        // street.
        IRow row = null;
        while ((row = cursor.NextRow()) != null)
        {
            Console.WriteLine("Street name: {0} {1}. - Alt. name: {2} {3}.",
                row.get_Value(streetsNameIndex), row.get_Value(streetsTypeIndex),
                row.get_Value(altnameNameIndex), row.get_Value(altnameTypeIndex));
        }
    }
  • 相关阅读:
    【题解】LOJ #6488 数表【FWT】
    【题解】[Comet OJ Contest #11 F] arewell【子集卷积】
    【CF757F】 Team Rocket Rises Again 【支配树】
    支配树学习笔记
    JS模拟实现题目(new debounce throwee 等)
    React生命周期
    js转义符
    CSS3中的transform转换属性
    animation动画
    flex
  • 原文地址:https://www.cnblogs.com/vichang/p/9168460.html
Copyright © 2011-2022 走看看