删除所有记录的最佳方法?

编程入门 行业动态 更新时间:2024-10-24 10:24:18
本文介绍了删除所有记录的最佳方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有这样的表格

i have table like this

Id Employee_Id Sector_Id Date 1 xxx kkk 2015-12-15 1 sss ddd 2015-12-15 1 fff nnn 2015-12-15

i想删除所有基于sector_Id和给定日期的记录?? i有搜索谷歌但是没有办法一次删除所有记录 i我正在使用此代码

i want to delete all records base on sector_Id and given date?? i have search google but there is no method to delete all record at once i am using this code

var deleteRecord1 = _service.GetAllDutyPointStatus().Where(x => x.Date == dt && x.Sector_Id == sectorId).Count(); if (deleteRecord1 != null) { _service.DeleteDutyPointStatus(deleteRecord1); } else { MsgLitteral.ShowNotificationInline("No Record Found!.", true); }

推荐答案

实现所需内容的最简单方法是使用以下SQL根据您的过滤条件删除所有记录。 The easiest way to acheive what you want is to use following SQL to delete all records based on your filter criteria. DELETE FROM <table_name> WHERE SECTOR_ID = <sector_id> AND DATE = <date></date></sector_id></table_name>

上面将删除TABLE_NAME中具有日期的特定sector_id的所有记录。

Above will delete all records in TABLE_NAME of specific sector_id with Date.

更多推荐

删除所有记录的最佳方法?

本文发布于:2023-11-01 18:31:27,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1550087.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:方法

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!