Click here to Skip to main content
15,922,894 members
Home / Discussions / Database
   

Database

 
GeneralRe: Using Parameterized queries in OLEDB Pin
Muammar©3-Sep-08 10:40
Muammar©3-Sep-08 10:40 
JokeRe: Using Parameterized queries in OLEDB Pin
Wendelius3-Sep-08 10:51
mentorWendelius3-Sep-08 10:51 
GeneralRe: Using Parameterized queries in OLEDB Pin
TheMandolinMan4-Sep-08 11:56
TheMandolinMan4-Sep-08 11:56 
GeneralRe: Using Parameterized queries in OLEDB [modified] Pin
Wendelius4-Sep-08 12:17
mentorWendelius4-Sep-08 12:17 
QuestionHelp in Query?? [modified] Pin
geekfromindia3-Sep-08 5:11
geekfromindia3-Sep-08 5:11 
AnswerRe: Help in Query?? Pin
Blue_Boy3-Sep-08 5:20
Blue_Boy3-Sep-08 5:20 
GeneralRe: Help in Query?? Pin
geekfromindia3-Sep-08 5:23
geekfromindia3-Sep-08 5:23 
AnswerRe: Help in Query?? Pin
Ashfield3-Sep-08 5:25
Ashfield3-Sep-08 5:25 
You can if you have say a datemodified column

select id, newname,oldname
from emp e1
left outer join emp e2 on e2.id = e1.id
and e2.datemodified = (select max(datemodified) from emp e3 where e3.id = e2.id
and e3.datemodified < e2.datemodified)


I might have a bit wrong here, as I don't have sql server on this PC so can't test, but you get the idea - find the same id where the datemodified is the latest date for this id BUT less than the current record, using an out join as presumably not every record will have been changed.

Hope this helps

Bob
Ashfield Consultants Ltd

GeneralRe: Help in Query?? Pin
geekfromindia3-Sep-08 5:33
geekfromindia3-Sep-08 5:33 
GeneralRe: Help in Query?? Pin
geekfromindia3-Sep-08 5:42
geekfromindia3-Sep-08 5:42 
GeneralRe: Help in Query?? Pin
Ashfield3-Sep-08 7:34
Ashfield3-Sep-08 7:34 
QuestionSQL DTS help, need certain fields from excel sheet to update in DB Pin
a_kubiak3-Sep-08 3:34
a_kubiak3-Sep-08 3:34 
QuestionShowing precentage using GROUP BY clause Pin
Muammar©3-Sep-08 1:45
Muammar©3-Sep-08 1:45 
AnswerRe: Showing precentage using GROUP BY clause Pin
Paddy Boyd3-Sep-08 2:37
Paddy Boyd3-Sep-08 2:37 
GeneralRe: Showing precentage using GROUP BY clause Pin
Muammar©3-Sep-08 3:47
Muammar©3-Sep-08 3:47 
AnswerRe: Showing precentage using GROUP BY clause Pin
Ashfield3-Sep-08 2:41
Ashfield3-Sep-08 2:41 
GeneralRe: Showing precentage using GROUP BY clause Pin
Muammar©3-Sep-08 3:55
Muammar©3-Sep-08 3:55 
GeneralRe: Showing precentage using GROUP BY clause Pin
Ashfield3-Sep-08 5:19
Ashfield3-Sep-08 5:19 
Questionquery to get number of childs from parent child table Pin
sepel2-Sep-08 20:38
sepel2-Sep-08 20:38 
AnswerRe: query to get number of childs from parent child table Pin
Blue_Boy2-Sep-08 20:47
Blue_Boy2-Sep-08 20:47 
AnswerRe: query to get number of childs from parent child table Pin
razov2-Sep-08 23:48
razov2-Sep-08 23:48 
AnswerRe: query to get number of childs from parent child table Pin
Paddy Boyd3-Sep-08 2:38
Paddy Boyd3-Sep-08 2:38 
QuestionHow to prevent adding a duplicate value into a table Pin
makumazan842-Sep-08 13:25
makumazan842-Sep-08 13:25 
AnswerRe: How to prevent adding a duplicate value into a table Pin
Blue_Boy2-Sep-08 13:43
Blue_Boy2-Sep-08 13:43 
GeneralRe: How to prevent adding a duplicate value into a table Pin
makumazan842-Sep-08 15:01
makumazan842-Sep-08 15:01 

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.