Click here to Skip to main content
15,892,746 members
Home / Discussions / Database
   

Database

 
AnswerRe: How many concurrent we can have in SQL Server 2005 Express? Pin
Michel Godfroid29-Apr-10 23:48
Michel Godfroid29-Apr-10 23:48 
GeneralRe: How many concurrent we can have in SQL Server 2005 Express? Pin
Roger Wright30-Apr-10 7:06
professionalRoger Wright30-Apr-10 7:06 
GeneralRe: How many concurrent we can have in SQL Server 2005 Express? Pin
Michel Godfroid30-Apr-10 7:24
Michel Godfroid30-Apr-10 7:24 
QuestionCyrillic characters · Serbian characters in sql server 2005 Pin
abcurl28-Apr-10 20:38
abcurl28-Apr-10 20:38 
AnswerRe: Cyrillic characters · Serbian characters in sql server 2005 Pin
Bernhard Hiller28-Apr-10 22:32
Bernhard Hiller28-Apr-10 22:32 
GeneralRe: Cyrillic characters · Serbian characters in sql server 2005 Pin
abcurl29-Apr-10 3:32
abcurl29-Apr-10 3:32 
GeneralRe: Cyrillic characters · Serbian characters in sql server 2005 Pin
Bernhard Hiller29-Apr-10 22:54
Bernhard Hiller29-Apr-10 22:54 
QuestionmySQL query question Pin
Jon Braunsma28-Apr-10 10:16
Jon Braunsma28-Apr-10 10:16 
I have a database with a master - detail relationshio between two tables. The database is basically a snapshot in time for each office. so imagine that my master table is:

id (auto increment), date, office_id
1 , 2010-4-1, 100
2 , 2010-4-2, 100
3 , 2010-4-3, 100
4 , 2010-4-4, 100
5 , 2010-4-1, 101
6 , 2010-4-2, 101
7 , 2010-4-3, 101
8 , 2010-4-4, 101

I want to get the id number for the last update date from the master table so I did the following:

SELECT id, max(upload_date) as upload_date, office_id from master group by office_id

What I want is the id number associated with the latest date, so I WANT
id, date, office
4, 2010-4-4,100
8, 2010-4-4,101

What I get is:
1, 2010-4-4,100
5, 2010-4-4,101

I get the max date, but the first id number. Normally I'd do a cursor in a procecure to get it, but the ISP has to grant the pivs each time the sp is modified so I am trying to do this in a simple query since it is called from php.

As a work around, I am doing a max(id) as well since I figured that the highest id would always be associated with the latest date, but I don't want to make that assumption.

Does anyone know how to build the query correctly to get the id associated with the latest date?
AnswerRe: mySQL query question Pin
Luc Pattyn28-Apr-10 10:59
sitebuilderLuc Pattyn28-Apr-10 10:59 
GeneralRe: mySQL query question Pin
Md. Marufuzzaman28-Apr-10 22:31
professionalMd. Marufuzzaman28-Apr-10 22:31 
GeneralRe: mySQL query question Pin
Luc Pattyn29-Apr-10 0:49
sitebuilderLuc Pattyn29-Apr-10 0:49 
GeneralRe: mySQL query question Pin
Md. Marufuzzaman29-Apr-10 0:58
professionalMd. Marufuzzaman29-Apr-10 0:58 
AnswerRe: mySQL query question Pin
Md. Marufuzzaman28-Apr-10 22:27
professionalMd. Marufuzzaman28-Apr-10 22:27 
GeneralRe: mySQL query question Pin
Mycroft Holmes28-Apr-10 23:35
professionalMycroft Holmes28-Apr-10 23:35 
AnswerRe: mySQL query question Pin
Chris Meech29-Apr-10 2:37
Chris Meech29-Apr-10 2:37 
QuestionHow to get the list of all dependent procedures? Pin
A M SOMAN28-Apr-10 1:48
A M SOMAN28-Apr-10 1:48 
AnswerRe: How to get the list of all dependent procedures? Pin
Henry Minute28-Apr-10 2:43
Henry Minute28-Apr-10 2:43 
AnswerRe: How to get the list of all dependent procedures? Pin
Md. Marufuzzaman28-Apr-10 22:19
professionalMd. Marufuzzaman28-Apr-10 22:19 
Questioni need a help with this problem in sql server 2005 ,, please,, please Pin
necib201028-Apr-10 0:47
necib201028-Apr-10 0:47 
AnswerRe: i need a help with this problem in sql server 2005 ,, please,, please Pin
Mycroft Holmes28-Apr-10 3:24
professionalMycroft Holmes28-Apr-10 3:24 
QuestionSelecting random top 3 listings per shop for a range of active advertising shops Pin
Graeme_Grant27-Apr-10 21:24
mvaGraeme_Grant27-Apr-10 21:24 
AnswerRe: Selecting random top 3 listings per shop for a range of active advertising shops Pin
Graeme_Grant27-Apr-10 22:13
mvaGraeme_Grant27-Apr-10 22:13 
GeneralRe: Selecting random top 3 listings per shop for a range of active advertising shops Pin
Mycroft Holmes28-Apr-10 3:21
professionalMycroft Holmes28-Apr-10 3:21 
QuestionHow Entertaining! [modified] Pin
Roger Wright27-Apr-10 17:35
professionalRoger Wright27-Apr-10 17:35 
AnswerRe: How Entertaining! Pin
_Damian S_27-Apr-10 17:41
professional_Damian S_27-Apr-10 17:41 

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.