1 (edited by FoxTech 2023-12-19 11:40:31)

Topic: Summary - Nomenclature SQL Query combine 2 or more columns into 1.

Just something I figured out along the way. I don't know if it has been discussed already elsewhere.

https://autumn.revolt.chat/attachments/fiOzW9GlM6ncNhsjmLwubEGIvRd2sWNJ3yYkTCLt0O

SELECT
    diagram_position || ' - ' || position AS 'Page - Location'
        FROM element_nomenclature_view
            WHERE ( element_type = 'terminal' OR element_type = 'thumbnail' OR element_type = 'simple' OR element_sub_type = 'commutator' OR element_sub_type = 'coil' OR element_sub_type = 'protection') AND machine_manufacturer_reference !=''
                ORDER BY machine_manufacturer_reference, diagram_position, position, description, manufacturer, manufacturer_reference

Using the || to combine multiple columns into 1 and ' - ' just adding - as text with a space on either side.