由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Database版 - how to fetch the first record from a table?
相关主题
怎么用Update实现这个?random sampling with replacement, how?
SQL run a stored procedure by fetching from a cursor row by rowquery 求助
Re: 用Servlet显示数据库里的数据,分页的? (答案在这里)奇怪的 SQL 问题
数据库问题求解oracle pl sql recursive function
To get the 2nd, 3rd, 4th largest value请教set和select 的区别
请问sql这个querry怎么写question: copy first N rows from table B to table A (DB2)
怎么用sql query 实现这个功能?A question of filling in missing value in SQL
请教一个mysql 排序问题。请问sql server里面怎么输出变量到文本文件?
相关话题的讨论汇总
话题: fetch话题: record话题: table话题: first话题: select
进入Database版参与讨论
1 (共1页)
z*y
发帖数: 1311
1
I want to fetch the first record from a table. but I don't know
how to do it by using select. Coule anyone help me? thanks.
D****N
发帖数: 430
2
to get first record sorted on someindex you can
use:
SELECT TOP 1
something, something, something
FROM
sometable
ORDER BY
someindex

【在 z*y 的大作中提到】
: I want to fetch the first record from a table. but I don't know
: how to do it by using select. Coule anyone help me? thanks.

z*y
发帖数: 1311
3

not working, what version you are using? I'm using oracle sql.

【在 D****N 的大作中提到】
: to get first record sorted on someindex you can
: use:
: SELECT TOP 1
: something, something, something
: FROM
: sometable
: ORDER BY
: someindex

j****s
发帖数: 271
4
select column
from tab
where your_conditions and ROWNUM = 1;

【在 z*y 的大作中提到】
:
: not working, what version you are using? I'm using oracle sql.

1 (共1页)
进入Database版参与讨论
相关主题
请问sql server里面怎么输出变量到文本文件?To get the 2nd, 3rd, 4th largest value
问问题的同学看过来。请问sql这个querry怎么写
请问一个SQL语句的优化问题怎么用sql query 实现这个功能?
How To Retrieve This Record? 谢谢请教一个mysql 排序问题。
怎么用Update实现这个?random sampling with replacement, how?
SQL run a stored procedure by fetching from a cursor row by rowquery 求助
Re: 用Servlet显示数据库里的数据,分页的? (答案在这里)奇怪的 SQL 问题
数据库问题求解oracle pl sql recursive function
相关话题的讨论汇总
话题: fetch话题: record话题: table话题: first话题: select