Click here to Skip to main content
15,907,395 members
Home / Discussions / Database
   

Database

 
Questioncan not get union recordset from two Sql Server2K store procedure Pin
Zhenjie Fu11-Apr-12 22:28
Zhenjie Fu11-Apr-12 22:28 
AnswerRe: can not get union recordset from two Sql Server2K store procedure Pin
Eddy Vluggen12-Apr-12 9:02
professionalEddy Vluggen12-Apr-12 9:02 
GeneralRe: can not get union recordset from two Sql Server2K store procedure Pin
Zhenjie Fu12-Apr-12 22:31
Zhenjie Fu12-Apr-12 22:31 
GeneralRe: can not get union recordset from two Sql Server2K store procedure Pin
Eddy Vluggen13-Apr-12 7:25
professionalEddy Vluggen13-Apr-12 7:25 
QuestionSQL Top n By Group Pin
Richard.Berry10011-Apr-12 16:47
Richard.Berry10011-Apr-12 16:47 
AnswerRe: SQL Top n By Group Pin
Corporal Agarn12-Apr-12 3:08
professionalCorporal Agarn12-Apr-12 3:08 
GeneralRe: SQL Top n By Group Pin
Richard.Berry10012-Apr-12 6:39
Richard.Berry10012-Apr-12 6:39 
GeneralRe: SQL Top n By Group Pin
Corporal Agarn12-Apr-12 6:50
professionalCorporal Agarn12-Apr-12 6:50 
Sorry, being at work I do not have a lot of time.

I believe what is needed is a sub query so you can then use a WHERE clause to get only three of each. If you are using 2008 you might try WITH.
This has not been tested but something like:
SQL
SELECT Produce, Net_Price 
FROM (
SELECT a.product, a.net_price, 
    ROW_NUMBER() Over(order by b.date_despatched DESC) AS RowNum
from opdetm a 
inner join Opheadm b 
on a.order_num = b.order_num ) AS c
WHERE RowNum < 4

GeneralRe: SQL Top n By Group Pin
Richard.Berry10012-Apr-12 7:10
Richard.Berry10012-Apr-12 7:10 
QuestionI have a problem in a SSIS solution !!! Pin
ma.amer11-Apr-12 2:30
ma.amer11-Apr-12 2:30 
AnswerRe: I have a problem in a SSIS solution !!! Pin
PIEBALDconsult11-Apr-12 3:15
mvePIEBALDconsult11-Apr-12 3:15 
GeneralRe: I have a problem in a SSIS solution !!! Pin
ma.amer11-Apr-12 3:24
ma.amer11-Apr-12 3:24 
GeneralRe: I have a problem in a SSIS solution !!! Pin
PIEBALDconsult11-Apr-12 14:38
mvePIEBALDconsult11-Apr-12 14:38 
GeneralRe: I have a problem in a SSIS solution !!! Pin
ma.amer24-Apr-12 13:02
ma.amer24-Apr-12 13:02 
GeneralRe: I have a problem in a SSIS solution !!! Pin
PIEBALDconsult24-Apr-12 13:29
mvePIEBALDconsult24-Apr-12 13:29 
AnswerRe: I have a problem in a SSIS solution !!! Pin
Mycroft Holmes11-Apr-12 12:50
professionalMycroft Holmes11-Apr-12 12:50 
GeneralRe: I have a problem in a SSIS solution !!! Pin
PIEBALDconsult11-Apr-12 14:39
mvePIEBALDconsult11-Apr-12 14:39 
QuestionWeird character conversion Pin
fd975010-Apr-12 22:21
professionalfd975010-Apr-12 22:21 
AnswerRe: Weird character conversion Pin
fd975011-Apr-12 2:19
professionalfd975011-Apr-12 2:19 
Newsconnection to database Pin
Micah David10-Apr-12 7:18
Micah David10-Apr-12 7:18 
GeneralRe: connection to database Pin
Richard MacCutchan10-Apr-12 8:33
mveRichard MacCutchan10-Apr-12 8:33 
QuestionNative paging on Sql Server Pin
SSEAR10-Apr-12 6:13
SSEAR10-Apr-12 6:13 
AnswerRe: Native paging on Sql Server Pin
jschell10-Apr-12 8:54
jschell10-Apr-12 8:54 
GeneralRe: Native paging on Sql Server Pin
SSEAR10-Apr-12 18:37
SSEAR10-Apr-12 18:37 
GeneralRe: Native paging on Sql Server Pin
jschell11-Apr-12 10:03
jschell11-Apr-12 10:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.