Skip to content
Advertisement

Tag: postgresql

Data type when reading from a TSV-file (postgresql)

Im reading data from a tsv-file to a postgresql table. The problem I have is that in one column (death year) it is either a year or N if the actor is not dead yet. If i try to use INTEGER as data type I get an error because of the N. Do anyone know how to solve this? This

Unable to join queries

I hope you’re able to help with this, it is creating a lot of unnecessary work for me… I have a lot of users that are assigned a unique session_id each time they start the game. This means they can get multiple session_id ‘s in a single day if they crash and/or just restart the app. I want to be

How do I create cohorts of users from month of first order, then count information about those orders in SQL?

I’m trying to use SQL to: Create user cohorts by the month of their first order Sum the total of all the order amounts bought by that cohort all-time Output the cohort name (its month), the cohort size (total users who made first purchase in that month), total_revenue (all order revenue from the users in that cohort), and avg_revenue (the

How to run SQL query with inside a javascript loop(map)?

what I’m trying to do is: loop through array of objects using map function run multiple SQL queries according to object append result of queries with object I’m looping through offers which is array of object.I get free_item and buy_item which are associated with offer.I am using knexjs for postgresql database with nodejs Here’s actual code: The Problem is it

PostgreSQL: aggregate records by time interval

I would like to generate reports of GPS capturing rate by travel modes. I have in a table modes the type of travel modes used by users. So for example, the following is the sample data for travel mode by user 10 for different trips. And then for each user and for each trip, user’s GPS traces are recorded in

Using PostgreSQL COPY

I’m using JMeter for insert summary data file to PostgreSQL. I tried copy instead of COPY but I’m getting error at copy syntax. I found out COPY is for only server-side, so I us copy for client-side. Here is my query Here is the error: org.postgresql.util.PSQLException: ERROR: syntax error at or near “” at position: 1 Answer copy is not

Advertisement