SQL Sorting and Grouping

Asked

Viewed 59 times

-2

How could I sort this table by placing it in order of the Field name column not being in alphabetical order and following the Right to Right field. For example, each field name has several different names:

inserir a descrição da imagem aqui

  • It’s hard to understand what you want. Gives to understand that you want to separate the fields of each row and regroup in a new row, what is absurd to a table of a database.

  • If the Field name column is alphanumeric what sort of sorting you want for such a field?

  • @Jânioprocópioferreira Could you add in the text of your question how you want the final presentation? Post example.

1 answer

0

Your question got a little fuzzy, but we’ll try.

SQL has a sort command, it is the order by which may be asc (defult) or desc (descending order).

basically you should do:

select [campos]
from [tabela]
where [condição]
order by [campo ordenado] [asc/desc]

Browser other questions tagged

You are not signed in. Login or sign up in order to post.