Starting with 2 tables, I want to get all rows with value in a certain column(cName) that is present on 1 table but not the other. I want to do this for both tables. I found a solution to use LEFT JOIN which gives me solution for 1 of the tables and I used UNION to combine. Is this a
MS Access fast Combo Box with VBA
I have a form which has a ComboBox on it that pulls records via ID and displays Name from a linked table. Standard look for values in the form combo box wizard generated. It works perfectly fine, but …
SQL Weighted averages of multiple rows –
How would you go about to find the real weighted average of multiple rows: By real weighted, I mean like this calculator: https://www.rapidtables.com/calc/math/weighted-average-calculator.html (and not by multiplying value with weight). The weight for each answer is set in answers and values for each question…
Hive SQL cast string as timestamp without losing the milliseconds
I have string data in the form 2020-10-21 12:49:27.090 I want to cast it as a timestamp. When I do this: select cast(column_name as timestamp) as column_name from table_name all of the milliseconds are dropped, like this: 2020-10-21 12:49:27 I also tried this: select cast(date_format(column_name,’yyyy-M…
Oracle merge – unable to get stable set of rows after deleting duplicates
I have this query to merge data from the individuals2 table. I still get the “unable to get a stable set of rows” error after deleting all the full_name duplicates in individuals2. What am I missing? Answer Your problem might be in the lower(FULL_NAME)expression in the join condition. It is not en…
Are nested SQL queries atomic?
I have some micro service (almost) system where each program has its own port. Moreover, not all ports in the system are available. For simplicity, I decided to keep a list of free ports in a table in PostgreSQL. Accordingly, I have this table: Respectively, if the value in the service column is null, then th…
Left join vs subquery [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed last year. Improve this question I have the following query with left join can I make this as subquery instead? Will it work fa…
Is it possible to get data of two different rows in one row (postgres)
I have this table whereby the data of the same customer id is in a new row: Is it possible to get a one row of the data like below: I tried joining but then i get the same as the table where it prints out two data instead of one. Might be my join isn’t correct. Appreciate the help.
SQ writing queries
In SQL how do I display only the columns LastName, FirstName, BusinessEntityID (show the output in that order) all rows? Answer It’s pretty simple:
Calculate time difference between two records and insert into another table if difference is greater than 30 seconds
I have the following table Tran_DeviceAttRec table: I want to select and insert only those fields which time difference is more than 30 second into temp table for example if emp_id 2 punchdate is 2021-02-01 16:52:48.000 and Dev_direction is IN and the same emp_id 2 punchdate is 2021-02-01 16:52:54.000 and Dev…