How to Rename Column of a Table by Using Kusto Query | Kusto Query Language Tutorial (KQL)

 Topic: How to Rename The Column of a Table by Using Kusto Query Language.


How to rename the column of a table by using Kusto Query | Kusto Query Language Tutorial (KQL) Kusto Query Language is a powerful tool to explore your data and discover patterns, identify anomalies and outliers, create statistical modeling, and more. The query uses schema entities that are organized in a hierarchy similar to SQL's: databases, tables, and columns. A Kusto query is a read-only request to process data and return results. The request is stated in plain text, using a data-flow model that is easy to read, author, and automate. Kusto queries are made of one or more query statements.

 //.rename column  
 // .rename column can be used to rename columns  
   
 //Let's create sampel table TotalSale and insert some data.  
   
 .create table TotalSale (  
   id: int   
   ,SalePersonFName: string  
   ,SalePersonLName : string  
   ,ProductName : string  
   ,ItemsSold : int  
   ,SoldPrice :real  
   ,SoldDate: date  
   ,City : string  
   ,State : string  
   ,Country : string  
   ,Region : string  
   )  
        
      //Insert data  
       .ingest inline into table TotalSale <|  
 11,Tamara,Tony,Cell Phone,2,1200.50,2015-03-03,Frankfurt,Hesse,Germany,Europe  
 9,Petra,Henry,TV,10,5000.89,2015-04-08,Paris,Île-de-France,France,Europe  
 3,Christy,Ladson,TV,3,1600,2015-04-02,High Point,NC,USA,North America  
 7,Chirag,Patel,Cell Phone,5,1500,2015-06-23,AhmadAbad,Gujrat,India,Asia  
   
 //Check the data in table  
 TotalSale  
   
 //Let's Rename SalePersonFName to FName only  
 //Syntax: .rename column [DatabaseName .] TableName . ColumnExistingName to ColumnNewName  
 .rename column TotalSale.SalePersonFName to FirstName  
 .rename column TotalSale.SalePersonLName to LastName  
   
 //Check the data in table  
 TotalSale  

Video Demo: How to Rename Column of a Table by Using Kusto Query Language

1 comment:

  1. While you may come across multiple websites that help out with online movie and television series streaming, we stand out. With us, you do not have to get yourself a subscription or probably create an account. Pick a movie of your choice and start watching on 123movies. Great Quality videos of 123movies 123movies believe in helping out with the best quality videos for a great viewing experience. Whether you are enjoying it alone or have friends coming over for a get-together, we ensure that you have a great time watching the movies of your choice with no compromise in quality. 123movies have Movies of All Genres It doesn’t matter what type of movie you enjoy watching, 123movies have it all sorted for you. You do not have to scroll around looking for the movie of your choice. Simply click the section that you prefer and we will help you with the right movie. Movies from around the world in 123movies We believe in helping our viewers with an experience that isn’t region-specific. We help you with movies from around the world just so that you get to bring about a change to what you watch. Even though you may like a certain type of movies, there are times when you will want to bring about a change. 123movies can be accessed Anytime Anywhere When it comes to accessing 123movies website to watch a movie of your choice, we help you with it anywhere and anytime that you feel like. You choose a time and a place and we are right there for you to help out.

    ReplyDelete