How to retrieve records sorted by or in sql statement
咔萌琪服饰
咔萌琪服饰 2020-07-11 12:00:36
0
1
1180

For example, this related article statement:

SELECT * FROM zbp_post WHERE log_Type = '0' AND log_Status = '0' AND ((1 = 1) AND ( log_Tag LIKE '%{155}%' OR log_Tag LIKE '%{3}%' OR log_Tag LIKE '%{8}%' ) ) LIMIT 10 OFFSET 0

I want to take out the tag 155 first, then the tag 3, and then the tag 8

But the result of this statement is messy. It is not the result I want.

How can I get the sorting result I want, thank you!

咔萌琪服饰
咔萌琪服饰

reply all(1)
知本

zbp_post There should be a sorting field in this table, please look for it. Before adding to the limit statement, order by field name desc (sort from large to small) or asc (sort from small to large)

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template