I have table which contains list of data ceparated by coma eg I am trying to left joint it with IN clause, but without success Answer One option uses string functions:
Tag: csv
Hive – Split and count values by delimiter – lateral view explode
I have a following Hive table I need to split and get the count values of each item in item_val column Expected output I tired below count but values are not getting delimited properly. Please help! Answer In Hive, one option is to use the lateral view syntax:
Joining on 3 csv files
I need to retrieve data from 3 different CSV files (Adres.CSV, ID.CSV and Regios.CSV) and combine this in an Excel table. This SQL statement works fine, StrSQL = “SELECT ID.[ID], Adres.[Naam], …
Powershell how to use SQL syntax on system.data.datatable foreach variable lookup?
I am using a data table in Powershell ISE on 2 large csv files. The second file is used to lookup various facilities by ID number found in File1. So, File2 has either 1 or many facilities depending on where they go. I’m trying to do a standard foreach loop, but not sure how to populate where the number variable
List of values as table
I’m looking for a smarter way to have a list of values as a table in Oracle. What I do nowadays is select ‘value1’ as val from dual union select ‘value2’ from dual What I’m hoping for is some …
Use COPY to read a csv into database, while adding constant columns
I have a series of CSV files, in the format: “Alice”,”Bob”,”A”,123.46,”4″ “Charlie”,”Dana”,”B”,987.6543,”9″ … I want to produce a table like this: id file_id mch c1 c2 c3 c4 …
Why am I getting “Invalid input syntax for type integer” in postgresql when importing a CSV?
I’m trying to import a .csv file to my postgresql DB. I created a table as follows: Then I used the following command to import the .csv file And my .csv file contains the following: However, this doesn’t work and the following message appear: Answer Maybe there is a BOM in the CSV? hexdump the file, and inspect the first
SQL: Efficient way to count and group results by like value
I have a table that looks like this: What is the most efficient way to query it and return the following ? I was thinking to use case when statements but it seems messy. Answer In Presto you can split the delimited list into an array, then unnest the array. This gives you one record per element in each list.
Can I use string_split with enforcing combination of labels?
So I have the following table: Id Name Label ————————————— 1 FirstTicket bike|motorbike 2 SecondTicket bike 3 ThirdTicket e-bike|…
How can I import data from excel to postgres- many to many relationship
I’m creating a web application and I encountered a problem with importing data to a table in a postgress database. I have excel with id_b and id_cat(books id and categories id) books have several categories and categories can be assigned to many books, excel looks like this: excel data It has 30 000 records. I have a problem how to