我在这个表中有一个表6列和5行,数据只存在第三行现在如何使用sql找出第三行的数据 [英] I have one table 6 column and 5 rows in this table and data is present only third row now how can find out the data of third row using sql

查看:242
本文介绍了我在这个表中有一个表6列和5行,数据只存在第三行现在如何使用sql找出第三行的数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这个表中有一个表6列和5行,数据现在只有第三行现在如何使用sql找到第三行的数据

I have one table 6 column and 5 rows in this table and data is present only third row now how can find out the data of third row using sql

推荐答案

假设数据在表中,如下所示:

Suppose the data is in a table, like this:
CREATE TABLE table_01 (
   [data_01][nvarchar](32),
      [data_02][nvarchar](31),
         [data_03][nvarchar](30),
            [data_04][nvarchar](29),
               [data_05][nvarchar](28),
                  [data_06][nvarchar](12)
       )



五乘六意味着[table_01]共有五条记录。现在创建另一个表 - > [table_02]:


"Five by six" would mean that [table_01] held a total of five records. Now create another table -> [table_02]:

CREATE TABLE table_02 (
   [idx][int]IDENTITY(1,1),   
      [data_01][nvarchar](32),
         [data_02][nvarchar](31),
            [data_03][nvarchar](30),
               [data_04][nvarchar](29),
                  [data_05][nvarchar](28),
                     [data_06][nvarchar](12)
       )



新表[table_02]现在可以了容易填写[table_01]的内容:


The new table [table_02] can now be filled with the content of [table_01] easily:

INSERT INTO [table_02]
   SELECT * FROM [table_01]



现在原始的五乘六数组已编入索引,您可以指定选择所需记录的序数:


Now that the original five-by-six "array" is indexed, you specify an ordinal by which the required record is selected:

SELECT * FROM [table_02] WHERE [idx] = 3


这篇关于我在这个表中有一个表6列和5行,数据只存在第三行现在如何使用sql找出第三行的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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