Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
2.4 kB
3
Indexable
Never
SELECT 
  COUNT(*) AS count,
  'company' AS column_name,
  company AS column_value
FROM Tl2.biview.activelocations
GROUP BY company
HAVING COUNT(*) > 1
UNION ALL
SELECT 
  COUNT(*) AS count,
  'zone' AS column_name,
  zone AS column_value
FROM Tl2.biview.activelocations
GROUP BY zone
HAVING COUNT(*) > 1
UNION ALL
SELECT 
  COUNT(*) AS count,
  'assignment_zone' AS column_name,
  assignment_zone AS column_value
FROM Tl2.biview.activelocations
GROUP BY assignment_zone
HAVING COUNT(*) > 1
UNION ALL
SELECT 
  COUNT(*) AS count,
  'size' AS column_name,
  size AS column_value
FROM Tl2.biview.activelocations
GROUP BY size
HAVING COUNT(*) > 1
UNION ALL
SELECT 
  COUNT(*) AS count,
  'max_volume' AS column_name,
  max_volume AS column_value
FROM Tl2.biview.activelocations
GROUP BY max_volume
HAVING COUNT(*) > 1
UNION ALL
SELECT 
  COUNT(*) AS count,
  'total_locations' AS column_name,
  total_locations AS column_value
FROM Tl2.biview.activelocations
GROUP BY total_locations
HAVING COUNT(*) > 1
UNION ALL
SELECT 
  COUNT(*) AS count,
  'locations_with_inventory' AS column_name,
  locations_with_inventory AS column_value
FROM Tl2.biview.activelocations
GROUP BY locations_with_inventory
HAVING COUNT(*) > 1
UNION ALL
SELECT 
  COUNT(*) AS count,
  'empty_locations' AS column_name,
  empty_locations AS column_value
FROM Tl2.biview.activelocations
GROUP BY empty_locations
HAVING COUNT(*) > 1
UNION ALL
SELECT 
  COUNT(*) AS count,
  'location_capacity' AS column_name,
  location_capacity AS column_value
FROM Tl2.biview.activelocations
GROUP BY location_capacity
HAVING COUNT(*) > 1
UNION ALL
SELECT 
  COUNT(*) AS count,
  'volume_occupied_by_volume' AS column_name,
  volume_occupied_by_volume AS column_value
FROM Tl2.biview.activelocations
GROUP BY volume_occupied_by_volume
HAVING COUNT(*) > 1
UNION ALL
SELECT 
  COUNT(*) AS count,
  'percentage_occupied_by_volume' AS column_name,
  percentage_occupied_by_volume AS column_value
FROM Tl2.biview.activelocations
GROUP BY percentage_occupied_by_volume
HAVING COUNT(*) > 1
UNION ALL
SELECT 
  COUNT(*) AS count,
  'units' AS column_name,
  units AS column_value
FROM Tl2.biview.activelocations
GROUP BY units
HAVING COUNT(*) > 1
UNION ALL
SELECT 
  COUNT(*) AS count,
  'determination_zone' AS column_name,
  determination_zone AS column_value
FROM Tl2.biview.activelocations
GROUP BY determination_zone
HAVING COUNT(*) > 1;