General discussion

Locked

sql query

By munish3012 ·
i have table that contain appointmentdate and FirstName and LastName i need sql Query for sorting

i have records like

AppointmentDate FirstName LastName
10/1/2009 2.00 Munish Rathore
10/1/2009 3.20 Munish Rathore
10/1/2009 3.50 Munish Rathore
10/1/2009 4.50 Munish Rathore
10/1/2009 3.50 Sandeep Shanrma
10/1/2009 4.50 Sandeep Shanrma
10/1/2009 3.50 Vicky Shanrma
10/1/2009 4.50 Vicky Shanrma

Now i want to show in Grid in particular
sorting order
10/1/2009 3.50 Munish Rathore
10/1/2009 4.50 Sandeep Shanrma
10/1/2009 4.50 Vicky Shanrma
after then all repeat records
10/1/2009 2.00 Munish Rathore
10/1/2009 3.20 Munish Rathore
10/1/2009 3.50 Munish Rathore
10/1/2009 3.50 Sandeep Shanrma
10/1/2009 3.50 Vicky Shanrma


10/1/2009 3.50 Munish Rathore
10/1/2009 4.50 Sandeep Shanrma
10/1/2009 4.50 Vicky Shanrma
10/1/2009 2.00 Munish Rathore
10/1/2009 3.20 Munish Rathore
10/1/2009 3.50 Munish Rathore
10/1/2009 3.50 Sandeep Shanrma
10/1/2009 3.50 Vicky Shanrma


Means all single unique first and last name will merge

Thanks

This conversation is currently closed to new comments.

3 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Homework eh?

by The 'G-Man.' In reply to sql query

good luck!

Collapse -

Maybe i'm just tired

by Shellbot In reply to sql query

But I'm not really getting what your asking for here...

What is it you want to sort on? And whats the deal with the "repeat records" showing after the first group..

Your putting this in 1 grid yes?

Collapse -

Don't get it, youir sort appears to be duplicating records

by Tony Hopkinson In reply to sql query

is far from obvious from what you've presented.

If you want to to have one result set with invisble sections sorted differently say

Mynames
Fred 1
Bill 2
Alfie 3

Fred 1
Bill 2
Alfie 3
Alfie 3
Bill 2
Fred 1

Not a clue why you would but if you did...

Select Name,SortOrder From MyNames Order By SortOrder
UNION
Select Name,SortOrder From MyNames Order By Name

would do it.

Back to Web Development Forum
3 total posts (Page 1 of 1)  

Related Discussions

Related Forums