Skip to content

Flag if there is a JOIN – SQL

Two tables with same field names >> student.id in student table (a) and student.id in record table (b) If student.id from student table is also in record table (join on a.student.id = b.student….

Identify duplicate record in Dataframe

I have a dataframe as below which identifies full name of any person: ——————- | f_name | l_name | ——————- | abc | xyz | | xyz | abc | | pqr | lmn | ———–…

Updating 20 rows in a table is really slow

I can’t figure out why updating only 21 rows in a table takes so much time. Step 1: I’m creating #tempTable from the StagingTable (it will never have more than 20 rows of data) CREATE TABLE #tmpTable (…

Hiveql – Aggregating hourly data to daily

I’m very new to Hiveql and would like some help with a very simple issue. I have a table of hourly data, I’ve provided a simplified example below: datetimetimezone ID value 202007130000+0100 001 2 …

SQL – sum operations within case when statement

I need to aggregate some sessions by day, country etc. The table has a transaction amount for each session (in local currency) and a field with the exchange_rate to EUR for the time of the transaction….

Create a column based on conditions in select statement

I have an order table in Postgres with order number and status as column. If a new order is placed the default status were Order placed and Goods Assigned. order 12345 order 543223 I want to know if the order were out from the sender place. So I want to create a column called started and has value Yes if