sql查询排序的有关问题
sql查询排序的问题
SELECT * , group_concat( ' ' , concat_ws( ' X ', `sku` , `quantity-purchased` ) , ' ' ),group_concat(' ' , `order_id` , ' ') FROM `sale_orders` WHERE `shipments` =0 AND `number` =$id GROUP BY `recipient-name` , `ship-address-1` ORDER BY `sku`
请问group_concat( ' ' , concat_ws( ' X ', `sku` , `quantity-purchased` ) , ' ' )所产生的结果能不能排序???
以下为查询的结果:
ship name sku-quantity
001-01 wang A0015-00-04-23 X 1
002-02 liu A0041-00-WW-25 X 1 , A0042-00-AC-25 X 1
003-03 li A0041-00-WW-25 X 1 , A0256-00-O6-34 X 1 , A0042-00-AC-25 X 1
004-04 fang A0042-00-AC-25 X 1 , A0041-00-WW-25 X 1 , A0217-00-SI-33 X 1
sku-quantity字段整体是按照SKU来排序的,我是想要每条记录的SKU也能排序。
------解决方案--------------------
FROM `sale_orders`
改为
FROM ( select * from `sale_orders` order by `sku`) T

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



With the rapid development of e-commerce, more and more companies choose to open online malls and sell products online. For a mall, SKU (StockKeepingUnits) is a very important concept. SKU is a specific code defined by merchants to better manage product inventory. It can uniquely identify a product and record the characteristics and attributes of the product. In order to better manage SKU inventory, merchants need to develop a dedicated SKU inventory management system. in the text

Title: Using the String.Concat function in C# to connect strings In C# programming, strings are a common data type, and we often need to concatenate strings. C# provides a variety of ways to concatenate strings, one of the commonly used methods is to use the String.Concat function. This article will introduce how to use the String.Concat function and provide specific code examples. The String.Concat function is a static method used to connect multiple

An inspection on the Douyin platform found that some merchants have violated the rules of attracting users’ clicks through low-priced SKUs, including but not limited to “low-priced SKUs across categories”, “low-priced SKUs across styles”, “single piece/main set” "Mixed selling of parts and accessories," etc., have had a negative impact on the platform's consumer experience and the platform's fair and just business environment. In order to improve consumers' shopping experience, we will continue to optimize the shopping platform environment, continue to review and remove fraudulent products that attract traffic at low prices. For those merchants who maliciously cheat and violate regulations, we will take more severe measures and upgrade their stores. Special rectification plan: For illegal products, the Douyin platform will carry out management and control measures such as product interception, reduction of exposure, and removal and banning; for merchants who still fail to comply after being fined three times or more

How to implement database design for product multi-specification SKU in PHP In e-commerce platforms, product specifications are a very important concept. Product specifications can be understood as the different attributes and characteristics of the product, such as size, color, weight, etc. In practical applications, for different specifications, we often need to set different prices, inventory, pictures and other information for each combination. This requires us to design a suitable database structure to store and manage product specifications and related information. This article will introduce how to implement multi-specification SKU of products in PHP

Roughly one year after announcing the Core Ultra Series 1, also known as Meteor Lake, Intel follows up with the second generation. Core Ultra Series 2 aka Lunar Lake was already introduced at June's Computex. At IFA, the final launch of the Core Ultr

How to use PHP to implement product multi-specification SKU function Product multi-specification SKU is a common product attribute setting on e-commerce platforms. It allows merchants to set different specifications and prices for the same product to meet consumers' different needs and preferences. This article will introduce how to use PHP to implement the multi-specification SKU function of products and provide corresponding code examples. Hope it helps readers in need. 1. Data structure design Before realizing the multi-specification SKU function of products, we need to design the data structure of the database first. Suppose there are three products

How to handle the addition, deletion, modification and search of SKU products in PHP mall development. With the rapid development of e-commerce, more and more companies choose to sell products online. Among them, SKU (StockKeepingUnit) products are an indispensable part of e-commerce. SKU is a code that uniquely identifies and tracks a product, and contains information such as the product's attributes, specifications, price, etc. In PHP mall development, processing the addition, deletion, modification and search of SKU products is one of the important details. 1. The increase of SKU products in PH

PHP coding practice: How to implement the multi-specification SKU function of products In e-commerce websites, the multi-specification SKU (StockKeepingUnit) function of products is a very common requirement. Through multi-specification SKUs, we can easily manage different attributes of goods, such as size, color, capacity, etc., and implement inventory management and price calculation for different attribute combinations. This article will introduce how to use PHP to implement the multi-specification SKU function of products, and come with relevant code examples. 1. Database design First, we need to design the database
