Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Pause SQL execution?

Author  Topic 

eoinreilly
Starting Member

1 Post

Posted - 2006-05-21 : 19:43:00
Hi,

Could somebody please suggest a statement for the following. I want to select the last 2 rows of every table in an SQLite database whose name ends in 'day'. I'm connecting to the database from Java and ideally I wish to enter data retrieved from a table directly to a data structure in Java before SQL moves onto the next table. Is this possible to do without creating a temporary table and reading from it into data structure?

Many Thanks

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-05-21 : 21:48:25
You can give this a try.
select top 2 * from yourtable where name like '%day' order by yourcolumn


However, do note that this is a MS SQL Server forums.


KH

Go to Top of Page

chiragkhabaria
Master Smack Fu Yak Hacker

1907 Posts

Posted - 2006-05-22 : 01:37:32
Little modification
quote:


select top 2 * from yourtable where name like '%day' order by yourcolumn  Desc  -- Last 2 records are required 




If Debugging is the process of removing Bugs then i Guess programming should be process of Adding them.
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-05-22 : 03:58:40
thanks chiragkhabaria


KH

Go to Top of Page
   

- Advertisement -