In my query I have one last obstacle I’m trying to overcome. My goal is to group products (“prod”) by the specified category (“prodcat”) and have a subtotal for each column’s worth …
sql duplicates within duplicates
Having a hard time wording my issue. But finding duplicates within duplicates is about as close as i can get without an example. ID is the id of the row. stringA,stringB are just arbitrary strings. dID,oID are FK relationship to other tables. I am trying to create a query that will give me all the rows where …
More than one row returned by a subquery when using STRING_AGG function
I get an error when trying to execute SELECT query in PostgreSQL 11 And authors_string should be fetched as a string value. It throwns an error ERROR: more than one row returned by a subquery used as an expression I guess it happens because of GROUP BY in subquery and can be handled with row_to_json function,…
Trigger SQL statement
Hi so I have am writing a statement to create a trigger in Oracle that would append the text to the description of every new game inserted into the database. I want the format to be like Format: (…
Creating a sheet from sql requests
I am doing request to get values from a game’s database to help the dev doing balance changing depending on rune using per each 10 levels, and the rune upgrade, so for it, i created a request for each …
MySql select all records from the table with month and year in the range from that month and year to all the past [closed]
I have a table with two fields “month” and “year” how can I make a query that, passing a month and a year, select everything from that month and year back. For example, if the …
remove olde records grouping by three columns and ordering by date
this is the situation: CREATE SEQUENCE SEQ_tmpdata MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 2206 NOCACHE ORDER NOCYCLE NOKEEP NOSCALE GLOBAL; CREATE TABLE …
If ID has both values A and B it should return AB
INPUT: ID VALUES 1 A 1 B 2 A 3 B OUTPUT: ID VALUES 1 AB 1 AB 2 A 3 B If ID has both values A and B it should return AB.
Showing conditional Where Condition in SQL SERVER
I am trying to achieve something like this. SELECT Name, Age From Employee WHERE ID=1 AND CASE(WHEN backguid=’00000000-0000-0000-0000-000000000000′ THEN (State=@state and City = @city) ELSE (…
Select query returning only one result per product?
I’m working with a MySQL database, where I have to tables. A product-table with unique product and a price-table that contains Several prices for each product. Today I use the following query, that …