Ich brauche Sie zu helfen.Interbase SQL remake a Wählen Sie die Abfrage
Ich habe eine Interbase SQL-Select-Abfrage:
Select aps.fullname, aps.productvcode, aps.alccode, aps.capacity, Guss (Round (Sum (Fall, wenn wp.capacity> 0 dann wp .Quantity wp.capacity */10 * anderes wp.quantity wp.capacity Ende), 4) als DECIMAL (18,4)), wie von WBTotal AP aps links Waybill_positions verbinden wp auf wp.alccode = aps.alccode wo wp.alccode = '0001821000001389010' Gruppe von aps.fullname, aps.productvcode, aps.alccode, aps.capacity
union all
Select aps.fullname aps.productvcode, aps.alccode, aps.capacity, Besetzung (Round (Summe (Fall bei wp.capacity> 0 dann wp.quantity * wp.capacity/10 sonst wp.quantity * wp.capacity end), 4) als DECIMAL (18,4)) als WBTotal von AP aps links beitreten Waybill_out_positions wp auf wp.alccode = aps.alccode wo wp.alccode = '0001821000001389010' Gruppe von aps.fullname, aps.productvcode, aps.alccode , aps.capacity
Aber ich möchte den Wert "156,9750" aus der zweiten Reihe sein eine separate Spalte rechts neben „WBTOTAL“ und hat den Titel „WBOTOTAL“
Wie es zu tun?
Dank Arbeitete ... .. Kann ich nur die gleiche Art und Weise andere Tabellen hinzufügen? – SovereignSun
@SovereignSun, sicher, dass Sie mehrere CTE in einer Abfrage haben können. Sie können mehr Referenz in diesem Link haben https://msdn.microsoft.com/en-us/library/ms175972.aspx –
Vielen Dank! – SovereignSun