0

I have two columns named country and country1 in the same table which are having same datatype and data stored also same i.e., India and United_states, but country has 40 rows of data which is combination of India and United_states and country1 has 60 rows. I need to sort the data based on India and United_states separately. So can any1 help me in this? when i am trying to sort the data either country1 gets sorted or country gets sorted but not both using MySQL.

#Name#  #country#           #country1#
  A      India               United states
  B      United states       United states
  C      India               United states
  D      India               India
  E                          India

i need something like dis

Name# #country# #country1

A India
C India D India India E India

Community
  • 1
  • 1

1 Answers1

0

Try this:

   SELECT * FROM your_table WHERE country = 'India' AND country1 = India ORDER BY country DESC, country1 DESC
Citizen SP
  • 1,411
  • 7
  • 36
  • 68