如何在sql中创建动态索引 [英] how to make a dynamic index in sql

查看:144
本文介绍了如何在sql中创建动态索引的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这里我有一个简单的Sql查询



 选择 * 来自广告





你知道这个查询给了我所有列和行,但我想再添加一列,显示每行旁边的索引(整数)。我没有为此目的的任何专栏,但我知道查询可以在执行时添加它。我应该更改我的查询以达到这个目标吗?

解决方案

请参考以下链接。



http://www.openwinforms.com /row_number_to_sql_select.html [ ^ ]



http://www.devx.com/tips/Tip/24234 [ ^ ]



https://msdn.microsoft.com/en-IN/library /ms186734.aspx [ ^

here i have a simple Sql query

select * from Advertisement



as you know this query gives me all columns and rows but i want to add one more column which shows index (integer number) next to every row . i don't have any column for this purpose but i know query can add it when it is executed.how should i change my query to reach this goal ?

解决方案

please refer below links.

http://www.openwinforms.com/row_number_to_sql_select.html[^]

http://www.devx.com/tips/Tip/24234[^]

https://msdn.microsoft.com/en-IN/library/ms186734.aspx[^]


这篇关于如何在sql中创建动态索引的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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