SQL查询以显示SL没有问题更新 [英] SQL query to display SL No of issue updates

查看:87
本文介绍了SQL查询以显示SL没有问题更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序中,我正在创建问题并将其加载到数据库中,表单中还有另一个选项卡,该选项卡允许用户更新问题,并且更新将显示在其旁边的datagridview中,即我有另一个该表将包含问题的所有更新.现在,我的关注点是依次显示所有更新,无论数据库中的SL No是什么,它都应按顺序显示所有更新.
我的issue_update表看起来像这样
SLNo int不为null,
Descrptn(8000)不为空,
日期日期时间不为null,
IssID varchar(50)不为null

SL No会自动递增
IssID是我们要为其更新的主要问题ID

Hi, in my application i am creating issues and loading to the DB, there is another tab in my form which will allow users to update the issue, and the updates will be shown in the datagridview next to it i.e. i have another table which will contain all the updates of the issues. Now my concern is to show all the updates one by one serially, what ever be the SL No in the database, it should show all the updates serially.
my issue_update table looks like this
SLNo int not null ,
Descrptn(8000) not null,
Date Datetime not null,
IssID varchar(50) not null

SL No is getting incremented automatically
and IssID is the main issue id for which we are updating

推荐答案

您可以使用Row_Number()函数获取序列号,而不是SL No column

语法....
You Can use Row_Number() function to get serial numbers instead of SL No column

Syntax....
Select Row_Number() over (order by Date) as [Sr No.] from TableName




希望对您有帮助...




Hope it helps...


这篇关于SQL查询以显示SL没有问题更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆