मैं 1300 पंक्तियाँ और 6 स्तंभों से मिलकर तालिका बनाने के लिए छत्ता में एक कोड लिख रहा हूँ:छत्ता QL में एक तालिका में एक कॉलम जोड़ें
create table test1 as SELECT cd_screen_function,
SUM(access_count) AS max_count,
MIN(response_time_min) as response_time_min,
AVG(response_time_avg) as response_time_avg,
MAX(response_time_max) as response_time_max,
SUM(response_time_tot) as response_time_tot,
COUNT(*) as row_count
FROM sheet WHERE ts_update BETWEEN unix_timestamp('2012-11-01 00:00:00') AND
unix_timestamp('2012-11-30 00:00:00') and cd_office = '016'
GROUP BY cd_screen_function ORDER BY max_count DESC, cd_screen_function;
अब मैं access_count1
होते हैं जो के रूप में एक और स्तंभ जोड़ना चाहते हैं सभी 1300 पंक्तियों और मान के लिए एक अद्वितीय मूल्य sum(max_count)
होगा। max_count मेरी मौजूदा तालिका में एक कॉलम है। मैं यह कैसे कर सकता हूँ? मैं इस कोड ALTER TABLE test1 ADD COLUMNS (access_count1 int) set default sum(max_count);
यदि मैं एकाधिक कॉलम जोड़ना चाहता हूं तो यह कैसे काम करता है? – Arun
'वैकल्पिक तालिका परीक्षण 1 जोड़ें COLUMNS (access_count1 int, access_count2 दिनांक, access_count3 स्ट्रिंग, ...); ' –
क्या ऑर्डर महत्वपूर्ण है जिसमें हम कॉलम जोड़ते हैं? –