Skip to content

Tag: sql

Left Join On And clause not supported

I’ve looked into various posts (this one, that one and this other one) and thought I got the answer. After a LEFT JOIN I may add an ON [condition] AND [other condition] (I’ve also tried WHERE). But …

Creating tables in InfluxDB via Terminal

Are there tutorials online that teaches you how to create tables and input values in InfluxDB? How would you create a table and insert values into them? Answer InfluxDB doesn’t really have the concept of a table. Data is structured into series, which is composed of measurements, tags, and fields. Measur…

Split a CSV field into different rows in SQL

A colleague of mines encountered this problem while working on a COBOL program and eventually solved it at the application level. Still I am curious if it is possible to solve it on the data access level, with SQL. This is somehow related to this other question, but I’d like to use only ANSI SQL. I&#821…

Pandas DENSE RANK

I’m dealing with pandas dataframe and have a frame like this: I want to make an equialent to DENSE_RANK () over (order by year) function. to make an additional column like this: How can it be done in pandas? Thanks! Answer Use pd.Series.rank with method=’dense’

PHP Loop through results

I am trying to loop through my database and check to see if the user already exists in another table. If they do then I want to increment a value, if they don’t then I want to add the user. When I run the code below it happily loops through all the results: However when I add in the SQL