AWS S3-Snowflake Pipeline Example | Snowflake Tutorials In Hindi
Web Performance In Hindi : Website Performance Kya Hai?
Snowlake UDF Example | User-Defined Functions In SNowflake In Hindi
Snowflake Virtual warehouses In Hindi | Create warehouse In Snowflake In Hindi
Web Page Kya Hai, Elements of web page in Hindi
How to setup MongoDB In Laravel : Laravel with MongoDB
Linux uname command Example | Linux get OS Info
JavaScript console Object : Window Console Object In Hindi
PHP filter_var() Function In Hindi | filter_var() In PHP In Hindi
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.
Snowflake में "sequence"
एक database object है जो automatic numeric values generate करता है। ये values एक particular order में increment करते हैं।
Sequences commonly primary keys या unique identifiers generate करने के लिए use किये जाते हैं।
●●●
CREATE [ OR REPLACE ] SEQUENCE [ IF NOT EXISTS ] <name> [ WITH ] [ START [ WITH ] [ = ] <initial_value> ] [ INCREMENT [ BY ] [ = ] <sequence_interval> ] [ { ORDER | NOORDER } ] [ COMMENT = '<string_literal>' ]
नीचे दिए गए example में increase_by_one
नाम से जो हर बार 1 से value increase करेगा।
-- create sequence
CREATE OR REPLACE SEQUENCE increase_by_one START = 1 INCREMENT = 1;
-- show all sequences
show sequences;
increase value get करने के लिए sequence की nextval
property होती है जो हर बार incremental value return करेगी।
SELECT increase_by_one.nextval;
output
+---------+ | NEXTVAL | |---------| | 1 | +---------+
Run again
SELECT increase_by_one.nextval;
Output
+---------+ | NEXTVAL | |---------| | 2 | +---------+
increase_by_one.nextval का use करके किसी table के auto increment field में values insert करते time use कर सकते हो।
single query में आप multiple call भी कर सकते हैं।
SELECT increase_by_one.nextval a, increase_by_one.nextval b, increase_by_one.nextval c;
output
+----+----+----+ | a | b | c | +----+----+----+ | 3 | 4 | 5 | +----+----+----+
●●●
किसी existing sequence को modify करने के लिए ALTER SEQUENCE
statement का use किया जाता है।
Syntax
ALTER SEQUENCE [ IF EXISTS ] <name> RENAME TO <new_name> ALTER SEQUENCE [ IF EXISTS ] <name> [ SET ] [ INCREMENT [ BY ] [ = ] <sequence_interval> ] ALTER SEQUENCE [ IF EXISTS ] <name> SET [ { ORDER | NOORDER } ] [ COMMENT = '<string_literal>' ]
ALTER SEQUENCE increase_by_one RENAME TO increaseByOne;
●●●
किसी existing sequence को modify करने के लिए DROP SEQUENCE
statement का use किया जाता है।
Syntax
DROP SEQUENCE [ IF EXISTS ] <name> [ CASCADE | RESTRICT ]
Example
DROP SEQUENCE IF EXISTS increaseByOne;
I Hope , आपको Snowflake में SEQUENCE
के बारे में अच्छे से समझ आया होगा।
●●●
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