I use this query in SQL to get return how many user_id’s have more than one email. How would I write this same query against a users DataFrame in Scala? also how would I be able to return to exact …
How to get SQL prepared statement based on user input (scanner)
I have difficulties with creating prepared statement which SELECT and print out rows which fulfill condition: SELECT ReservationStartDate, ReservationEndDate FROM treservations WHERE …
Recursive Query Sql Oracle 3 months difference between dates
I have a simply table with three columns, policy_no, casenumber and created_date. Multiple casenumbers can be logged against unique policy numbers. I need a query that runs through the data finds the …
SUM function consider NULL on Oracle 12c
I was trying to get the nulls on doing a SUM() function on sql and I figured out that sql now consider nulls, so if a column has a different value and a null value the sum is good calculated. For …
How to remove rest of the ordered rows with the same ID after the first row which occurs more than once with that ID?
I have the following structure for the table DataTable: every column is of the datatype int, RowID is an identity column and the primary key. LinkID is a foreign key and links to rows of an other …
How can i merge two columns of a table in sql as a sentence?
i am a beginner in database programming. I am doing my homework, and i get a task about sql queries. My task is to merge 3 columns(first name, last name, sex) of a table(person) in a sentence. for …
Get relation of a collection in rails
So simple but can’t find how to do it in rails. I have a specific active record collection of users. Something like users = User.where(blabla). Given this collection is there a simple way to get all …
Find all other records for an ID if a record exists
I need to find all other related records for an ID if a certain value exists. I have almost no SQL experience and work primarily on a front end design UI, rather than writing the code myself. The …
How to return boolean value if sub-query returns any result
I am attempting to write a query to audit a table of IP addresses against a table of overlapping net blocks. Individual net blocks can be marked active or inactive via a BOOLEAN. The audit query …
pg_restore: [directory archiver] could not open input file. Error while trying to restore DB
Error when trying to restore a backup file(.nb3). I did a database backups in Navicat, one backup for each schema. They are .nb3 files. I tried to restore my DB on a local server using pgAdmin. I got an error like this after choosing backup file : How do I restore the database on a local server? Answer NB3 Na…