Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

298
Views
Cómo ordenar por uso en codeigniter

Los datos de mi tabla son así.

IDENTIFICACIÓN NOMBRE ordenar
1 inglés 0
2 italiano 1
3 español 2
4 hindi 1
5 bengalí 3
6 tamil 2

mi consulta

 $this->db->select('*'); $this->db->from('languages'); $this->db->order_by('order','asc'); $query = $this->db->get();

Quiero datos como este order-1,1,2,2,3,0

IDENTIFICACIÓN NOMBRE ordenar
2 italiano 1
4 hindi 1
3 español 2
6 tamil 2
5 bengalí 3
1 inglés 0
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Prueba esto:

 create table order_1( id int(4), name varchar(20), `order` int(3) ); insert into order_1 values (1,'English',0), (2,'Italian',1), (3,'Spanish',2),(4,'Hindi',1),(5,'Bengali',3),(6,'Tamil',2); SELECT * FROM order_1 ORDER BY `order`= 0, `order`;

ingrese la descripción de la imagen aquí

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!