SELECT sample_id, item_id, test_id, report_no, report_id, sample_mass, batch_number, customer_name, customer_id, sample_name, sample_no, factory_number, test_quantity, total_fee, inspection_type, factory, receivable_fee, compile_user_name, compile_time, order_no, audit_user_name, audit_time, pass_user_name, pass_time, standard_instrument_name, test_date, item_state, print_count, generate_time, is_print, report_state, final_fee, node_name, report_id, test_result, test_address, bas_item_id, charges_number, price_id, item_ids, settlement_state, item_name, sample_remark, order_remark, group_name, group_id, test_rule, test_standard, group_name, receive_user_name, query_code, commission_date, invoice_title, product_type, clarity, labor_cost, label_price, precious_metal FROM view_sample_info 根据 report_no 进行排序 不需要加cast
时间: 2024-02-10 21:28:34 浏览: 48
db.xml.gz_Batch Imagej_Dolore_ID.DB_ea
您可以使用以下SQL查询语句来根据 `report_no` 进行排序,无需使用 `cast` 函数:
```sql
SELECT
sample_id,
item_id,
test_id,
report_no,
report_id,
sample_mass,
batch_number,
customer_name,
customer_id,
sample_name,
sample_no,
factory_number,
test_quantity,
total_fee,
inspection_type,
factory,
receivable_fee,
compile_user_name,
compile_time,
order_no,
audit_user_name,
audit_time,
pass_user_name,
pass_time,
standard_instrument_name,
test_date,
item_state,
print_count,
generate_time,
is_print,
report_state,
final_fee,
node_name,
report_id,
test_result,
test_address,
bas_item_id,
charges_number,
price_id,
item_ids,
settlement_state,
item_name,
sample_remark,
order_remark,
group_name,
group_id,
test_rule,
test_standard,
group_name,
receive_user_name,
query_code,
commission_date,
invoice_title,
product_type,
clarity,
labor_cost,
label_price,
precious_metal
FROM view_sample_info
ORDER BY report_no;
```
这将按照 `report_no` 的升序对结果进行排序。请注意,`CAST` 函数是用于数据类型转换,似乎您在问题中并没有要求进行数据类型转换。
阅读全文