惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

L
LangChain Blog
博客园 - 司徒正美
美团技术团队
WordPress大学
WordPress大学
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
人人都是产品经理
人人都是产品经理
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
T
Troy Hunt's Blog
S
Schneier on Security
T
The Exploit Database - CXSecurity.com
P
Proofpoint News Feed
云风的 BLOG
云风的 BLOG
Engineering at Meta
Engineering at Meta
Cisco Talos Blog
Cisco Talos Blog
T
Tor Project blog
B
Blog
NISL@THU
NISL@THU
月光博客
月光博客
博客园 - 【当耐特】
AWS News Blog
AWS News Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
腾讯CDC
L
Lohrmann on Cybersecurity
The Cloudflare Blog
L
LINUX DO - 最新话题
S
Security @ Cisco Blogs
S
Secure Thoughts
Spread Privacy
Spread Privacy
有赞技术团队
有赞技术团队
The Last Watchdog
The Last Watchdog
Project Zero
Project Zero
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Vercel News
Vercel News
H
Hacker News: Front Page
S
SegmentFault 最新的问题
Schneier on Security
Schneier on Security
aimingoo的专栏
aimingoo的专栏
P
Privacy & Cybersecurity Law Blog
博客园 - 三生石上(FineUI控件)
Forbes - Security
Forbes - Security
C
CXSECURITY Database RSS Feed - CXSecurity.com
I
InfoQ
T
Tailwind CSS Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
G
GRAHAM CLULEY
W
WeLiveSecurity
小众软件
小众软件
Recorded Future
Recorded Future
Cyberwarzone
Cyberwarzone
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org

博客园 - 小小飞鹰

MMM互助金融/理财源码 js 弹出窗口 防止拦截,突破阻止,保存后打开 .NET开发者必备的工具箱 NBIbatis web/winform框架 NBIbatis 微信框架 NBIbatis 框架体系说明 NBIbatis 基础框架 开源中国上一些有用的开源系统 TfS+强制删除签出锁定项 thinkphp支持大小写url地址访问,不产生下划线 sqlserver 链接 ODBC 访问 MySql ibatis + log4net 配置注意事项 Devexpress GridView内嵌dx:ASPxGridLookup取得控件值乱跳解决方案 【转】Asp.Net MVC及Web API框架配置会碰到的几个问题及解决方案 将关系数据库映射到业务实体 百度贴吧10亿量级LAMP架构分享 [转]ASP.NET中 WebSite 跟 WebProject 的异同 dynamics ax 2009 字段类似的表绑定界面注意 dynamics Ax 2009 实现 union 效果
dynamics ax 2009 distinct实现及数组集合
小小飞鹰 · 2011-09-14 · via 博客园 - 小小飞鹰

Posted on 2011-09-14 16:42  小小飞鹰  阅读(569)  评论()    收藏  举报

1 通过分组实现distinct
   select ItemType,GoodsName from tableA order by ItemType,GoodsName group by ItemType,GoodsName
            where tableA.ItemType == '传入的值';
    采用上述SQL就可得到distict后的值,如果要取出数据后再进行distinct可以采用2中介绍的Set类;
2 数组集合
  注意:
     1 List、Map、Struct、Array提供了可序列化的pack和unpack功能,可以减少RPC次数,提高速度;
     2 如果设置了key的类型,存入不同类型如:string-->int,会自动存默认值(0)进去;
[Set 类]
Set类中所有值得类型都相同;Set会自动排序并且所有值都是唯一的,插入重复的值时,Set会自动忽略。
   set.Add("");
   while(set.MoveNext())
   {
      set.current();
   }
[List 类]
List类同Set类的区别:
 可添加相同值,可选择插入前面或者后面;
 在List的顺序是添加时的顺序,不会自动排序;
   list.Add("");
   while(list.MoveNext())
   {
      list.current();
   }
[Map 类]
Map类保存键值对,键不能重复,当插入相同键时,用新值代替旧值,键自动排序。
   map.insert(1,"");
   while(map.MoveNext())
   {
      map.currentKey(),map.currentValue();
   }
[Struct 类]
Struct 类相当于没有方法的类,可拥有不同数据类型字段,但只能有一行记录。
   struct.value("ID",1);
   struct.value("name","");
   struct.add("","");
   for(i = 1; i <= struct.fields();i++)
   {
      struct.fieldname(i),struct.valueIndex(i);
   }
[Array 类]
Array 类使用类实现数组,可容纳任意数据类型,包括对象和表变量;索引值从1开始,相同的索引值新值替换旧值。
   array.value(1,"");
   for(i = 1; i <= array.lastIndex();i ++)
   {
      array.value(i);
   }
[Stack 类]
Stack 类是后进先出(LIFO)的数据结构类型,只能放置容器类型Container,添加和删除都从顶部开始。
   stack.push(Container1);
   conpeek(stack.pop(),1);
[StackBase 类]
StackBase 类同Stack 类,除了它可以放置任意类型。
   stackbase.push("");
   stackbase.pop();

非有希望才坚持,坚持才会有希望