Hi,
I want a help in sql server 2005 as mentioned below:
I want to select rows on top from a table which has more repeated values in a column.
For Example:
pEnt_ID ShortName FundID Received Date
---------------------------------------------------------------
58731 M IX A-3 NULL NULL
58729 M IX A-1 4 NULL
58730 M IX A-2 4 NULL
58729 M IX A-1 23772 NULL
58730 M IX A-2 23772 09/08/2010
58729 M IX A-1 4 NULL
I want to display the rows which has maximum repeated value in pEnt_ID column ie. 58729 on top and then so on.
Like this:
pEnt_ID ShortName FundID Received Date
---------------------------------------------------------------
58729 M IX A-1 4 NULL
58729 M IX A-1 4 NULL
58729 M IX A-1 23772 09/07/2010
58730 M IX A-2 4 NULL
58730 M IX A-2 23772 09/08/2010
58731 M IX A-3 NULL NULL
Please provide some query solution.
Thanks,
Rohan
I want a help in sql server 2005 as mentioned below:
I want to select rows on top from a table which has more repeated values in a column.
For Example:
pEnt_ID ShortName FundID Received Date
---------------------------------------------------------------
58731 M IX A-3 NULL NULL
58729 M IX A-1 4 NULL
58730 M IX A-2 4 NULL
58729 M IX A-1 23772 NULL
58730 M IX A-2 23772 09/08/2010
58729 M IX A-1 4 NULL
I want to display the rows which has maximum repeated value in pEnt_ID column ie. 58729 on top and then so on.
Like this:
pEnt_ID ShortName FundID Received Date
---------------------------------------------------------------
58729 M IX A-1 4 NULL
58729 M IX A-1 4 NULL
58729 M IX A-1 23772 09/07/2010
58730 M IX A-2 4 NULL
58730 M IX A-2 23772 09/08/2010
58731 M IX A-3 NULL NULL
Please provide some query solution.
Thanks,
Rohan
Comment