Click here to Skip to main content
15,898,953 members
Home / Discussions / Database
   

Database

 
AnswerRe: Fill gaps in rates data with previous working day rates. Pin
Mycroft Holmes30-Oct-11 12:52
professionalMycroft Holmes30-Oct-11 12:52 
QuestionGrant a role to another role Pin
Danzy8329-Oct-11 12:31
Danzy8329-Oct-11 12:31 
QuestionJust installed SQL Server 2008 R2 - Where is the app to create/open/add/update/delete DB file? Pin
swampwiz28-Oct-11 0:40
swampwiz28-Oct-11 0:40 
AnswerRe: Just installed SQL Server 2008 R2 - Where is the app to create/open/add/update/delete DB file? Pin
Geoff Williams28-Oct-11 1:29
Geoff Williams28-Oct-11 1:29 
AnswerRe: Just installed SQL Server 2008 R2 - Where is the app to create/open/add/update/delete DB file? Pin
phil.o28-Oct-11 2:25
professionalphil.o28-Oct-11 2:25 
QuestionNeed help with update SQL with subquery Pin
Hypermommy26-Oct-11 3:14
Hypermommy26-Oct-11 3:14 
AnswerRe: Need help with update SQL with subquery Pin
Corporal Agarn26-Oct-11 3:46
professionalCorporal Agarn26-Oct-11 3:46 
AnswerRe: Need help with update SQL with subquery Pin
Hypermommy26-Oct-11 6:03
Hypermommy26-Oct-11 6:03 
QuestionSELECT ... GROUP BY Error Pin
MikeDhaan26-Oct-11 1:07
MikeDhaan26-Oct-11 1:07 
AnswerRe: SELECT ... GROUP BY Error Pin
Simon_Whale26-Oct-11 1:13
Simon_Whale26-Oct-11 1:13 
GeneralRe: SELECT ... GROUP BY Error Pin
MikeDhaan26-Oct-11 1:59
MikeDhaan26-Oct-11 1:59 
GeneralRe: SELECT ... GROUP BY Error Pin
Jörgen Andersson26-Oct-11 2:37
professionalJörgen Andersson26-Oct-11 2:37 
GeneralRe: SELECT ... GROUP BY Error Pin
MikeDhaan26-Oct-11 5:14
MikeDhaan26-Oct-11 5:14 
GeneralRe: SELECT ... GROUP BY Error Pin
Jörgen Andersson26-Oct-11 23:46
professionalJörgen Andersson26-Oct-11 23:46 
GeneralRe: SELECT ... GROUP BY Error Pin
Jörgen Andersson27-Oct-11 0:09
professionalJörgen Andersson27-Oct-11 0:09 
GeneralRe: SELECT ... GROUP BY Error Pin
Blue_Boy26-Oct-11 5:00
Blue_Boy26-Oct-11 5:00 
AnswerRe: SELECT ... GROUP BY Error Pin
Chris Meech26-Oct-11 2:45
Chris Meech26-Oct-11 2:45 
GeneralRe: SELECT ... GROUP BY Error Pin
MikeDhaan26-Oct-11 4:23
MikeDhaan26-Oct-11 4:23 
GeneralRe: SELECT ... GROUP BY Error Pin
Chris Meech26-Oct-11 4:27
Chris Meech26-Oct-11 4:27 
GeneralRe: SELECT ... GROUP BY Error Pin
MikeDhaan26-Oct-11 4:57
MikeDhaan26-Oct-11 4:57 
GeneralRe: SELECT ... GROUP BY Error Pin
Mycroft Holmes26-Oct-11 5:03
professionalMycroft Holmes26-Oct-11 5:03 
GeneralRe: SELECT ... GROUP BY Error Pin
Chris Meech26-Oct-11 5:14
Chris Meech26-Oct-11 5:14 
Since there are multiple values the same in TheDate column it can not be used as a key and that is why you are getting those results. Another, more complicated way, is to use the date and type as a key. Try this
select date
      ,type
      ,value
  from table t
      , ( select max(date) max_date
                ,type type
            from Table 
           group by type
        ) tg
 where t.date = tg.max_date
   and t.type = tg.type
order by type
;

Chris Meech
I am Canadian. [heard in a local bar]

In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]

posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]

GeneralRe: SELECT ... GROUP BY Error Pin
MikeDhaan26-Oct-11 5:29
MikeDhaan26-Oct-11 5:29 
GeneralRe: SELECT ... GROUP BY Error Pin
Mycroft Holmes26-Oct-11 14:01
professionalMycroft Holmes26-Oct-11 14:01 
GeneralRe: SELECT ... GROUP BY Error Pin
Jörgen Andersson26-Oct-11 23:56
professionalJörgen Andersson26-Oct-11 23:56 

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.