dbTalk Databases Forums  

Top lines from SQLBASE table

comp.databases comp.databases


Discuss Top lines from SQLBASE table in the comp.databases forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
y.ambroise@yahoo.fr
 
Posts: n/a

Default Top lines from SQLBASE table - 05-17-2008 , 04:06 PM






Hi everybody,

I am facing a problem and I hope that somebody can help me. Here it
is : with SQL server, it is possible to make a request like ' SELECT
TOP(100) FROM TABLE '.
Does it exist the same form of request with SQLBASE ? How to get the
top
(first) lines of a table with one request ?

Thank you for your help

Reply With Quote
  #2  
Old   
Roy Hann
 
Posts: n/a

Default Re: Top lines from SQLBASE table - 05-18-2008 , 06:43 AM






<y.ambroise (AT) yahoo (DOT) fr> wrote

Quote:
Hi everybody,

I am facing a problem and I hope that somebody can help me. Here it
is : with SQL server, it is possible to make a request like ' SELECT
TOP(100) FROM TABLE '.
Does it exist the same form of request with SQLBASE ? How to get the
top
(first) lines of a table with one request ?
"First"? "Top"? What does that mean (to you)? Does it mean the same thing
to the DBMS? And the end users? Always? Forever?

See if there is a different approach to doing what you want. Fix the table
design if need be.

Roy




Reply With Quote
  #3  
Old   
Roy Hann
 
Posts: n/a

Default Re: Top lines from SQLBASE table - 05-18-2008 , 06:43 AM



<y.ambroise (AT) yahoo (DOT) fr> wrote

Quote:
Hi everybody,

I am facing a problem and I hope that somebody can help me. Here it
is : with SQL server, it is possible to make a request like ' SELECT
TOP(100) FROM TABLE '.
Does it exist the same form of request with SQLBASE ? How to get the
top
(first) lines of a table with one request ?
"First"? "Top"? What does that mean (to you)? Does it mean the same thing
to the DBMS? And the end users? Always? Forever?

See if there is a different approach to doing what you want. Fix the table
design if need be.

Roy




Reply With Quote
  #4  
Old   
Roy Hann
 
Posts: n/a

Default Re: Top lines from SQLBASE table - 05-18-2008 , 06:43 AM



<y.ambroise (AT) yahoo (DOT) fr> wrote

Quote:
Hi everybody,

I am facing a problem and I hope that somebody can help me. Here it
is : with SQL server, it is possible to make a request like ' SELECT
TOP(100) FROM TABLE '.
Does it exist the same form of request with SQLBASE ? How to get the
top
(first) lines of a table with one request ?
"First"? "Top"? What does that mean (to you)? Does it mean the same thing
to the DBMS? And the end users? Always? Forever?

See if there is a different approach to doing what you want. Fix the table
design if need be.

Roy




Reply With Quote
  #5  
Old   
y.ambroise@yahoo.fr
 
Posts: n/a

Default Re: Top lines from SQLBASE table - 05-18-2008 , 12:23 PM



Dear Roy,

I am not sure that you caught my problem. The only thing I would like
to know is : To be able to get the top rows from a table even if the
ordering /way of sorting (ORDER BY CLAUSE) is made by DESC or ASC

Can you help me ?

Regards
A.YAO

Reply With Quote
  #6  
Old   
y.ambroise@yahoo.fr
 
Posts: n/a

Default Re: Top lines from SQLBASE table - 05-18-2008 , 12:23 PM



Dear Roy,

I am not sure that you caught my problem. The only thing I would like
to know is : To be able to get the top rows from a table even if the
ordering /way of sorting (ORDER BY CLAUSE) is made by DESC or ASC

Can you help me ?

Regards
A.YAO

Reply With Quote
  #7  
Old   
y.ambroise@yahoo.fr
 
Posts: n/a

Default Re: Top lines from SQLBASE table - 05-18-2008 , 12:23 PM



Dear Roy,

I am not sure that you caught my problem. The only thing I would like
to know is : To be able to get the top rows from a table even if the
ordering /way of sorting (ORDER BY CLAUSE) is made by DESC or ASC

Can you help me ?

Regards
A.YAO

Reply With Quote
  #8  
Old   
Roy Hann
 
Posts: n/a

Default Re: Top lines from SQLBASE table - 05-19-2008 , 02:10 AM



<y.ambroise (AT) yahoo (DOT) fr> wrote


Quote:
I am not sure that you caught my problem. The only thing I would like
to know is : To be able to get the top rows from a table even if the
ordering /way of sorting (ORDER BY CLAUSE) is made by DESC or ASC
Well this is better. You are now asking the question in a way that is
capable of being answered.

Quote:
Can you help me ?
Sadly no. It is a conceit of SQL that it operates on sets (well, more
accurately, bags), and neither sets nor bags admit the concept of order. It
is like asking about colour in the context of Euclidean geometry. So
standard SQL has no way to do what you want. Various SQL dialects add the
ability as a non-standard extension, but there is not even a de facto
standard way to do it.

In the case of the SQL Server dialect, try "select top 10 * from table order
by col", but don't imagine it will be portable to any other dialect you also
want to use.

The only portable solution is one that doesn't call for random subsets of
rows. Unless you are writing a gambling application, try to find a
deterministic solution.

Roy




Reply With Quote
  #9  
Old   
Roy Hann
 
Posts: n/a

Default Re: Top lines from SQLBASE table - 05-19-2008 , 02:10 AM



<y.ambroise (AT) yahoo (DOT) fr> wrote


Quote:
I am not sure that you caught my problem. The only thing I would like
to know is : To be able to get the top rows from a table even if the
ordering /way of sorting (ORDER BY CLAUSE) is made by DESC or ASC
Well this is better. You are now asking the question in a way that is
capable of being answered.

Quote:
Can you help me ?
Sadly no. It is a conceit of SQL that it operates on sets (well, more
accurately, bags), and neither sets nor bags admit the concept of order. It
is like asking about colour in the context of Euclidean geometry. So
standard SQL has no way to do what you want. Various SQL dialects add the
ability as a non-standard extension, but there is not even a de facto
standard way to do it.

In the case of the SQL Server dialect, try "select top 10 * from table order
by col", but don't imagine it will be portable to any other dialect you also
want to use.

The only portable solution is one that doesn't call for random subsets of
rows. Unless you are writing a gambling application, try to find a
deterministic solution.

Roy




Reply With Quote
  #10  
Old   
Roy Hann
 
Posts: n/a

Default Re: Top lines from SQLBASE table - 05-19-2008 , 02:10 AM



<y.ambroise (AT) yahoo (DOT) fr> wrote


Quote:
I am not sure that you caught my problem. The only thing I would like
to know is : To be able to get the top rows from a table even if the
ordering /way of sorting (ORDER BY CLAUSE) is made by DESC or ASC
Well this is better. You are now asking the question in a way that is
capable of being answered.

Quote:
Can you help me ?
Sadly no. It is a conceit of SQL that it operates on sets (well, more
accurately, bags), and neither sets nor bags admit the concept of order. It
is like asking about colour in the context of Euclidean geometry. So
standard SQL has no way to do what you want. Various SQL dialects add the
ability as a non-standard extension, but there is not even a de facto
standard way to do it.

In the case of the SQL Server dialect, try "select top 10 * from table order
by col", but don't imagine it will be portable to any other dialect you also
want to use.

The only portable solution is one that doesn't call for random subsets of
rows. Unless you are writing a gambling application, try to find a
deterministic solution.

Roy




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.