📜  在 mysql 查询中提供硬编码值 - SQL 代码示例

📅  最后修改于: 2022-03-11 15:04:50.734000             🧑  作者: Mango

代码示例1
SELECT "" as Serial,
   "" as Object_ID,
   "" as ObjectDEsc,
   "" as Object_Num,
   "--(UNKNOWN -- )" as DropList
UNION
 SELECT CAST(p.Serial AS UNSIGNED INTEGER) as Serial, 
  p.Object_ID, 
  p.Part_ID, 
  st.Description AS ObjectDesc, 
  s.Object_Num, 
  concat(Serial,' (',st.Desc,' #',s.Object_Num,')') as DropList 
 FROM Parts p LEFT JOIN Objects s ON p.Object_ID = s.Object_ID 
 LEFT JOIN ObjectTypes st ON s.ObjectType_ID = st.ObjectType_ID