Selectsr_childas
Select sr_child
Select sr_child as 'child name', sr_parents as 'parent name', ss_updatetime as 'allocation time', left (ss_updatetime, CHARINDEX ('', ss_updatetime)-1 ), SUBSTRING (CONVERT (CHAR (19), ss_updatetime, 120),) as 'time after format conversion and truncation 'from dbo. tb_sell_resources, dbo. tb_sell_selldetails where sr_id = ss_rsid and ss_qdstate <> 1 order by ss_updatetime
String truncation function in SQL: SUBSTRING (name, start, end)
Name: field name in string format
Start: Specifies the start position (the start value is 1)
End: Specifies the position at which the string ends.
In SQL, The Datetime format is converted to the string format: 2000-01-01 01:01:01 (Datetime) CONVERT (CHAR (19), CURRENT_TIMESTAMP, 120)
CURRENT_TIMESTAMP: Current Time (Field Names in Datetime format can be written here, for example, ss_updatetime)
Other parameters (CHAR (19), 120, etc.) do not need to be modified
After use, 01:01:01 (Datetime) is changed to 01:01:01 (string format)