I am trying to get the most recent record(s) with a status of Registered, Expired, using the status date value to get the latest one. The query I have , I am using a specific lot number that has 13 …
Update Oracle table column with a sequence number based on varchar field in same table
I am in need of help with the syntax to update an existing field in an oracle table with a new number sequence based on the ordering of another field that is VARCHAR2. Current Table: CODE …
SQL does not recognize tablename from select statement
If I write the tablename after ‘FROM’ the query works. If I use the result of a select statement the query does not resolve. Is there a workaround? I have tried resolving the tablename as an output …
Create a view in SQL Server and lookup with another table
I’m very new to SQL and am trying to create a view in SQL Server using 2 tables. There are some conditions will impact the way of selecting data and I would appreciate some guidance on what’s the …
Putting a sql table into python error. Whats wrong?
I would like to know what’s going on with this query. Im not able of put it into a pandas data frame. The error description is “IndexError: tuple index out of range” i = 3 query = (“SELECT COL1, …
hibernate multiple @OneToMany relationships generating more results in parent relationship
I will start with the result. In the next image I am displaying the result content of company.userAccount. In the database I have only two companies assigned to the same user and 7 services attached to one of the companies. The generated query (simplified) is This will generate Expected result: I was expectin…
PostgreSQL Query GROUP BY Year/Month – No function matches the given name?
I’m working to write a PostgreSQL query that shows the number of new user signups create by month going back to the start of time in the database. Here’s what I have: SELECT COUNT(id) FROM users …
Determine record exist by exception of SQL is Principles?
I have a table with primary key and I want to insert new record to that. In my code, I check if record exists by exception. In the SQL stored procedure, I have insert code and surround by exception, …
MySQL get latest 7 days reservations, grouped by NameResource
I’m tring to write a query, without a good resultset. I would to retreive a Number of reservations in last 7 days. Grouped by NameOfResource. When i’m tring to set a WHERE clause like this …
Trying to write an inner join to filter out some conditions
I’m currently struggling with carrying out some joins and hoping someone can shed some light on this. I have three tables: A,B,C Table C lists names of individuals Table A lists the food they …