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 2005 Forums
 Transact-SQL (2005)
 Required specified top records in a table

Author  Topic 

mkj875
Starting Member

1 Post

Posted - 2010-08-22 : 09:47:37
Hi All,
Please help to solve the issue.
I have a 5 Table which contain few records
eg.
Table1 - 15
Table2 - 15
Table3 - 20
Table4 - 25
Table5 - 30
Now i want to display top 20 of each table, if the table didnt contains 20 record, i should get the remainder record from another table.
eg : Table1 - 15, Table2 - 15, Table3 - 20, Table4 - 25 and Table5 - 25

Please suggest how to right the quiery for it.

Thanks in Advance

Jawahar K

slimt_slimt
Aged Yak Warrior

746 Posts

Posted - 2010-08-22 : 11:48:48
what is the structure of this table? can you provide DDL?
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-08-22 : 12:16:23
whats the order in you want records? is it in same order Table1,Table2,... as given above?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -