1、基础查询 SELECT [DISTINCT] column1,column2..|* FROM table_name [WHERE conditions]; --distinct 去重 2、给字段设置别名 SELECT column1 AS column1_new ,... FROM table ...
分类:
其他好文 时间:
2020-07-05 19:42:35
阅读次数:
83
public ActionResult Index() { var musiclist = from i in ms.MusicInfo select i; //LinQ语句,从数据库中提取数据 //MusicInfo是一张表 return View(musiclist.ToList()); //执 ...
分类:
其他好文 时间:
2020-07-05 00:22:27
阅读次数:
69
集合元素如下: private List<string> dataSource = new List<string>() { "001", "002", "003", "004", "005" }; C# 代码,之前这样写: public void Run_v1() { var index = 0; ...
分类:
其他好文 时间:
2020-07-04 13:21:37
阅读次数:
97
XDocument 说明LINQ处理XML文件的一个类 添加引用 using System.Linq; using System.Xml.Linq; using System.Xml.XPath; 引用xml文件 XDocument xml = XDocument.Load("IOS.xml"); ...
List<Integer> collect = StreamSupport.stream(dwflztglbRepository.findAll().spliterator(), false).map(Dwflztglb::getZtId).distinct().collect(Collectors ...
分类:
编程语言 时间:
2020-07-02 16:46:26
阅读次数:
83
1、使用Sort() 当T是简单类型,int,double之类的可以直接用 var a = new List<int>(); a.Add(1); a.Add(5); a.Add(4); a.Sort();//排序 2、使用LinQ a = a.OrderByDescending(i => i.Nam ...
分类:
编程语言 时间:
2020-07-02 10:41:55
阅读次数:
56
#mysql中的union 语法: SELECT ... UNION [ALL | DISTINCT] SELECT ... [UNION [ALL | DISTINCT] SELECT ...] UNION用于把来自许多SELECT语句的结果组合到一个结果集合中。 列于每个SELECT语句的对应位 ...
分类:
数据库 时间:
2020-07-01 19:55:34
阅读次数:
57
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks; using ServiceStack.Redis; namespace te ...
分类:
其他好文 时间:
2020-07-01 09:36:28
阅读次数:
65
public PageInfo Get(string name, int PageIndex = 1, int PagepSize = 3) { PageInfo pg = new PageInfo(); if (name == null) { name=""; } int count = pg.D ...
分类:
其他好文 时间:
2020-06-30 20:25:06
阅读次数:
48
Given a collection of distinct integers, return all possible permutations. Example: Input: [1,2,3] Output: [ [1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1, ...
分类:
其他好文 时间:
2020-06-29 09:55:51
阅读次数:
59