Click here to Skip to main content
16,018,518 members
Home / Discussions / Database
   

Database

 
AnswerRe: Last record in MYSQL Pin
_Damian S_27-Jul-11 19:23
professional_Damian S_27-Jul-11 19:23 
AnswerRe: Last record in MYSQL Pin
thatraja28-Jul-11 15:26
professionalthatraja28-Jul-11 15:26 
QuestionFind Last Record In Sequence Pin
Adam Jasper26-Jul-11 0:45
Adam Jasper26-Jul-11 0:45 
AnswerRe: Find Last Record In Sequence Pin
Simon_Whale26-Jul-11 2:22
Simon_Whale26-Jul-11 2:22 
GeneralRe: Find Last Record In Sequence Pin
Adam Jasper26-Jul-11 2:32
Adam Jasper26-Jul-11 2:32 
GeneralRe: Find Last Record In Sequence Pin
Blue_Boy26-Jul-11 2:35
Blue_Boy26-Jul-11 2:35 
GeneralRe: Find Last Record In Sequence Pin
Adam Jasper26-Jul-11 2:39
Adam Jasper26-Jul-11 2:39 
GeneralRe: Find Last Record In Sequence Pin
Blue_Boy26-Jul-11 2:41
Blue_Boy26-Jul-11 2:41 
Based on that data of table which you have gave in your first post then query will work. Otherwise post data structure how they are in table.

by this query

select   max(mt.OldOrderID) as OldOrderID,

(select top 1 mt1.Data from mytable mt1 where mt1.OldOrderID = max(mt.OldOrderID)) as Data
from mytable mt
group by substring(mt.data, charindex('order',mt.data),len(mt.data)) 
order by max(mt.OldOrderID) desc


you will get this result

OldOrderID	Example Data<br />
7	The fourth order in sequence 2<br />
3	The fourth order in sequence 1


I Love T-SQL
"VB.NET is developed with C#.NET"
If my post helps you kindly save my time by voting my post.

www.cacttus.com

GeneralRe: Find Last Record In Sequence Pin
Adam Jasper26-Jul-11 3:16
Adam Jasper26-Jul-11 3:16 
GeneralRe: Find Last Record In Sequence Pin
Blue_Boy26-Jul-11 3:29
Blue_Boy26-Jul-11 3:29 
GeneralRe: Find Last Record In Sequence Pin
Adam Jasper26-Jul-11 3:33
Adam Jasper26-Jul-11 3:33 
AnswerRe: Find Last Record In Sequence Pin
Adam Jasper26-Jul-11 3:48
Adam Jasper26-Jul-11 3:48 
QuestionOracle.DataAccess.Client.OracleCommand.ExecuteNonQuery() interrupts execution of the whole program [modified] Pin
NandoMan25-Jul-11 11:51
NandoMan25-Jul-11 11:51 
GeneralRe: Oracle.DataAccess.Client.OracleCommand.ExecuteNonQuery() interrupts execution of the whole program Pin
Shameel31-Jul-11 7:25
professionalShameel31-Jul-11 7:25 
AnswerRe: Oracle.DataAccess.Client.OracleCommand.ExecuteNonQuery() interrupts execution of the whole program Pin
Herman<T>.Instance1-Aug-11 3:52
Herman<T>.Instance1-Aug-11 3:52 
QuestionSingle row for multiple results Pin
vanikanc22-Jul-11 7:54
vanikanc22-Jul-11 7:54 
AnswerRe: Single row for multiple results Pin
Blue_Boy22-Jul-11 8:20
Blue_Boy22-Jul-11 8:20 
GeneralRe: Single row for multiple results Pin
vanikanc22-Jul-11 8:27
vanikanc22-Jul-11 8:27 
GeneralRe: Single row for multiple results Pin
Blue_Boy22-Jul-11 8:28
Blue_Boy22-Jul-11 8:28 
AnswerRe: Single row for multiple results Pin
Tim Carmichael22-Jul-11 8:28
Tim Carmichael22-Jul-11 8:28 
GeneralRe: Single row for multiple results Pin
vanikanc22-Jul-11 8:42
vanikanc22-Jul-11 8:42 
AnswerRe: Single row for multiple results Pin
Shameel22-Jul-11 9:00
professionalShameel22-Jul-11 9:00 
AnswerRe: Single row for multiple results Pin
PIEBALDconsult23-Jul-11 14:07
mvePIEBALDconsult23-Jul-11 14:07 
AnswerRe: Single row for multiple results Pin
Niladri_Biswas24-Jul-11 22:37
Niladri_Biswas24-Jul-11 22:37 
SuggestionRe: Single row for multiple results Pin
_Zorro_25-Jul-11 4:22
professional_Zorro_25-Jul-11 4:22 

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.