Skip to content Skip to sidebar Skip to footer
Showing posts with the label Greatest N Per Group

How To Get The Latest Message In Each Conversation Of A Certain User In Sql?

I need to write a query that returns the latest message in a conversation between two users. I'… Read more How To Get The Latest Message In Each Conversation Of A Certain User In Sql?

Join Two Tables Where Table A Has A Date Value And Needs To Find The Next Date In B Below The Date In A

I got this table 'A': | id | date | =================== | 1 | 2010-01-13 | | 2 | 20… Read more Join Two Tables Where Table A Has A Date Value And Needs To Find The Next Date In B Below The Date In A

How Do I Get The Record Id Of The Record With The Min Date For Each Foreign Key?

I have the following table recordID createdDate ForeignKeyID … Read more How Do I Get The Record Id Of The Record With The Min Date For Each Foreign Key?