How to use Find Operator to Search Data in Multiple Tables in Azure Data Explorer DB by using Kusto

Topic: How to use Find Operator to Search Data in Multiple Tables in Azure Data Explorer DB by using Kusto


How to use the find operator to search Data in multiple tables in Azure Data Explorer DB by using Kusto Query Language | 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.

 // Using Search operator  
 .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 TotalSaleAsia <|  
 11,Tamara,Tony,Cell Phone,2,1200,2015-03-03,Frankfurt,Hesse,Germany,Europe  
 9,Petra,Henry,TV,10,5000,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  
 2,M,Raza,Cell Phone,2,800,2015-07-15,Charlotte,NC,USA,North America  
 5,Najaf,Ali,Computer,1,300,2015-06-20,Karachi,Sindh,Pakistan,Asia  
 6,Sukhjeet,Singh,TV,2,900,2015-06-21,ChandiGar,Punjab,India,Asia  
 4,John,Rivers,Laptop,5,2400,2014-03-09,Jersey City,NJ,USA,North America  
 8,Aleena,Aman,Laptop,2,800,2015-05-25,Lahore,Punjab,Pakistan,Asia  
 10,Rita,Roger,Laptop,7,2100,2015-04-11,Paris,Île-de-France,France,Europe  
 1,Aamir,Shahzad,TV,1,700,2015-07-15,Charlotte,NC,USA,North America  
 12,aamir,Shahzad,TV,1,7000,2015-07-15,Charlotte,NC,USA,North America  
 10,Rita,Roger,Laptop,7,2100,2015-04-11,Paris,Île-de-France,France,Europe  
 14,aamir,Shahzad,TV,1,7000,2015-07-15,Charlotte,NC,USA,South America  
 17,Chirag,Patel,Charger Cell Phone,5,1500,2015-06-23,AhmadAbad,Gujrat,India,Asia  
   
 //Find operator  
 Finds rows that match a predicate across a set of tables.  
   
 //Find value in all tables in the current database  
 find "aamir"  
   
 //find Column Value in All Tables with Different Columns to display from each Table  
 find SalePersonFName == 'aamir' or CustomerName == 'Aamir' project SalePersonFName,SalePersonLName,CustomerName,CustomerAddress,Salary  
   
 //find the records in which column has the value  
 find in (TotalSale,TotalSaleAsia) where SalePersonFName =="aamir"  
   
 //find the records in all the columns in all given tables  
 find in (TotalSale,TotalSaleAsia,Customer) where * =="aamir"  
 find in (TotalSale,TotalSaleAsia,Customer) where * =~"aamir"  
   
   
 // Find in entire database for specific column value  
 find in (database('techbrothersdb').*) where SalePersonFName == "aamir"  
   
 // Find in entire database for specific column value in all columns  
 find in (database('techbrothersdb').*) where * == "North America"  


Video Demo: How to use Find Operator to Search Data in Multiple Tables in Azure Data Explorer DB by using Kusto

No comments:

Post a Comment