Web Performance In Hindi : Website Performance Kya Hai?
Sequence In Snowflake | What is Sequence In Snowflake
AWS Create VPC Manually | Create VPC In AWS In Hindi
Web developer roadmap : How to become web developer ? web development kya hai ?
Snowflake Virtual warehouses In Hindi | Create warehouse In Snowflake In Hindi
Logical Operators In JavaScript In Hindi | JS Logical Operators In Hindi
what is CIDR (Classless Inter-Domain Routing or supernetting) In Hindi / CIDR kya hai
Insertion Sort in PHP With Example | How Does Insertion Sort Work in PHP
If tutorials available on this website are helpful for you, please whitelist this website in your ad blocker😭 or Donate to help us ❤️ pay for the web hosting to keep the website running.
programming language like PHP , Java , C , C++ etc की तरह ही आप Snowflake में भी variables को define कर सकते हैं। और इस topic में आप सीखेंगे कि कैसे Snowflake में variables define और use करते हैं।
variable किसी value को दिया गया नाम है , variables named storage हैं जिनकी value need के according change हो सकती है।
●●●
तो किसी variable को define करने के लिए Variable Name दे दिया जाता है , और जो भी value आपको assign करनी है वो आप directly =
की help से assign कर सकते हैं।
ध्यान रहे ये case in-sensitive होते हैं , मतलब var / Var / VAR एक ही variable नाम है।
variable को define करने के लिए SET
statement का use किया जाता है।
SET MY_VARIABLE=10;
आप जिस भी type की value assign करेंगे variable उसी type का होगा , आपको manually variable type define करने की need नहीं है।
SET MY_VARIABLE='example';
आप single statement में ही Multiple variables को भी initialized कर सकते हैं।
जिसमे आपको एक set / tuple
में variables name और दूसरी तरफ set / tuple
में उन variables की value होगी। जो values , variables के क्रम according assign हो जाएँगी।
SET (VAR1, VAR2, VAR3)=(10, 20, 30);
even आप किसी table से single row fetch करके भी variables set कर सकते हैं।
SET (VAR1, VAR2, VAR3)=(SELECT col1, col2, col3 from table limit 1);
●●●
current session में defined सभी variables देखने के लिए , SHOW VARIABLES
command का use किया जाता है।
SHOW VARIABLES;
SQL में variables temporary storage की तरह use में लिए जाते हैं , ये सिर्फ current session तक ही exist करते हैं , जिसका मतलब है आप इन्हे बाद में use नहीं कर सकते हैं।
●●●
define किये गए variables को आप normally SELECT
statement के साथ और $
का use करके access कर सकते हैं।
SELECT $MY_VARIABLE;
SELECT $VAR1;
इन variables को आप directly query में भी use कर सकते हैं।
SET (MIN, MAX)=(40, 70);
SELECT $MIN;
SELECT AVG(SALARY) FROM EMP WHERE AGE BETWEEN $MIN AND $MAX;
●●●
variables को unset / delete करने के लिए UNSET
command का use क्या जाता है।
UNSET V1;
UNSET V2;
-- unset multiple variables at once.
UNSET (V1, V2);
●●●
Loading ...
Hi ! I'm Rahul Kumar Rajput founder of learnhindituts.com. I'm a software developer having more than 4 years of experience. I love to talk about programming as well as writing technical tutorials and blogs that can help to others. I'm here to help you navigate the coding cosmos and turn your ideas into reality, keep coding, keep learning :)
Get connected with me. :) LinkedIn Twitter Instagram Facebook