Through Infor XA Power-Link, I have access to a sales history view with things like quantity, price, item number, etc. Using System i Navigator, I would like to be able to run a SQL script that produces a similar table, but customized to my liking. However, I’m having trouble locating the tables involve…
Can somebody give a practical example of a many to many relationship?
I learned about many-to-many relationships in College, and I never really understood them. So far I’ve been working with one-to-many relationships which are easy to understand and deal with. Can somebody please give a practical example of a many-to-many relationship, and explain why we need a bridging t…
Insert into two tables and affect the id of one of the table columns into the other table
I have a Folder table which contain the following columns: And I have another one called Images which contains: I want to insert an url in the folder table in a query and put it in the images and get the id in the same query. Actually, I am working on an Android project, I have to add a new
Comparing two empty Strings in Oracle SQL
Hi today I have met with weird situation. I had a where clause where was condition which returns String and I wanted to check if it’s empty or not. And when it returns empty string Oracle still treat …
Group timestamp by hour SQLite
I am trying to group my timestamp column which has a data type of TimeStamp by hour. So this works for grouping by day: I have tried the following for grouping by hour: But this gives me the error: no such function: HOUR: I have seen similar questions asked, but it was DateTime used, not TimeStamp. Additional…
How can I insert records into Postgres with RLS when user has `grant all` perms and a loose policy
I’m new to Postgres’ RLS feature. I believe I’m following the documentation appropriately, but am getting unexpected behavior. Consider the following case: i have a table named report_files this …
Oracle: SELECT value from where clause as dummy table
after a lot of searching I unfortunately couldn’t find a solution for the following task: I need an Oracle-SQL-Query that returns the value from the WHERE-clause as the result value. This sounds easy, but I just couldn’t find out how to achieve this. Example (how it should be): Desired Result: I k…
Postgres on conflict do update on composite primary keys
I have a table where a user answers to a question. The rules are that the user can answer to many questions or many users can answer one question BUT a user can answer to a particular question only once. If the user answers to the question again, it should simply replace the old one. Generally the on conflict…
How to create a database with UTF-8 collation in PostgreSQL on Windows?
I’m configuring PostgreSQL db for the Bitbucket Server on Windows. In the official guide it says that: The database must be configured to use the UTF-8 character set. It doesn’t strictly say that you have to set collation to UTF-8, but for other atlassian procucts it’s recommended so I assum…
Combining 2 queries in 1 (select based on other select)
I have 2 queries: and second one base on first one They work nice, but I need them to work as a one combined query, result from access looks like this: But this gives me only empty table. Can you help me? Answer Your inner join depends on the right-hand-side table of the left join, this effectively converts t…