/data-lake-analytics-u-sql-programmability-
guide#using-code-behind-1) from previous section, **above** .

    
    
    // Returns names and values for a given registry key
    
    @registry = 
        SELECT * FROM 
            ( VALUES
            (@"SYSTEM\CurrentControlSet\Control\CrashControl")
            ) AS T(registryKey);
    
    // aliasing namespace and class
    USING xx = RegOps.myReg;
    
    
    @result =
        SELECT T.key AS Name,
               T.value AS Value
        FROM @registry
             CROSS APPLY
                 EXPLODE(xx.regReader(registryKey)) AS T(key, value);
    
    OUTPUT @result
    TO "/ReferenceGuide/DML/FROM/Explode/keyValuePair1.txt"
    USING Outputters.Tsv(outputHeader: true);
    

**IEnumerable <Tuple> **

    
    
    @bands = 
      SELECT * 
      FROM (VALUES ("Beatles", "George Harrison, John Lennon, Paul McCartney, Ringo Starr"), 
                   ("Creedence Clearwater Revival", "Doug Clifford, John Fogerty, Stu Cook, Tom Fogerty"), 
                   ("Eagles", "Don Henley, Glenn Frey, Joe Walsh, Timothy Schmit"), 
                   ("Pink Floyd", "David Gilmour, Nick Mason, Richard Wright, Roger Watters, Syd Barrett"), 
                   ("Rolling Stones", "Charlie Watts, Keith Richards, Mick Jagger, Ronnie Wood")) AS Bands(name, members);
    
    @ca_tuple = 
      SELECT name, m1, m2, m3, m4 
      FROM @bands CROSS APPLY EXPLODE (new [] {Tuple.Create(members.Split(',')[0],
                                                            members.Split(',')[1],
                                                            members.Split(',')[2],
                                                            members.Split(',')[3] )}) AS T(m1,m2,m3,m4);
    
    OUTPUT @ca_tuple 
    TO "/output/ReferenceGuide/DML/Explode/crossapply_tuple.csv" 
    USING Outputters.Csv();
    

##  See Also

  * [ Query Statements and Expressions (U-SQL) ](../../../../concepts/expressions)
  * [ FROM Clause (U-SQL) ](../../from-clause)
  * [ SELECT Expression (U-SQL) ](../../../select-expression)
  * [ U-SQL SELECT Selecting from CROSS APPLY and OUTER APPLY ](../select-selecting-from-cross-apply-and-outer-apply)
  * [ Output Statement (U-SQL) ](../../../../output-statement)
  * [ ARRAY_AGG (U-SQL) ](../../../../functions/aggregate/array-agg)
  * [ MAP_AGG (U-SQL) ](../../../../functions/aggregate/map-agg)
  * [ Complex Built-In U-SQL Types ](../../../../data-types/built-in-u-sql-types)

* * *

##  Additional resources

[ California Consumer Privacy Act (CCPA) Opt-Out Icon  Your Privacy Choices
](https://aka.ms/yourcaliforniaprivacychoices)

Theme

  * Light 
  * Dark 
  * High contrast 

  *   * [ Previous Versions ](/en-us/previous-versions/)
  * [ Blog ](https://techcommunity.microsoft.com/t5/microsoft-learn-blog/bg-p/MicrosoftLearnBlog)
  * [ Contribute ](/en-us/contribute/)
  * [ Privacy ](https://go.microsoft.com/fwlink/?LinkId=521839)
  * [ Terms of Use ](/en-us/legal/termsofuse)
  * [ Trademarks ](https://www.microsoft.com/legal/intellectualproperty/Trademarks/)
  * © Microsoft 2024 

##  Additional resources

###  In this article

[ California Consumer Privacy Act (CCPA) Opt-Out Icon  Your Privacy Choices
](https://aka.ms/yourcaliforniaprivacychoices)

Theme

  * Light 
  * Dark 
  * High contrast 

  *   * [ Previous Versions ](/en-us/previous-versions/)
  * [ Blog ](https://techcommunity.microsoft.com/t5/microsoft-learn-blog/bg-p/MicrosoftLearnBlog)
  * [ Contribute ](/en-us/contribute/)
  * [ Privacy ](https://go.microsoft.com/fwlink/?LinkId=521839)
  * [ Terms of Use ](/en-us/legal/termsofuse)
  * [ Trademarks ](https://www.microsoft.com/legal/intellectualproperty/Trademarks/)
  * © Microsoft 2024