I have a table that stores logs of http fetches, let’s say we have two columns: fetch_url and success. A few example rows: success fetch_url TRUE A FALSE A FALSE B FALSE B FALSE …
Category: Questions
Why do I get an Error when I try to rename a table after FROM?
When I simply try to retrieve all of the rows in my table EMPLOYEE like this: SELECT * FROM EMPLOYEE AS emp; I get the following error: ORA-00933: SQL command not properly ended 00933. 00000 – &…
How to compare counts from subselect?
I want to compare the count between two tables. Or more to say, output if the count from table1 is greater than from table2: SELECT c1 > c2 FROM (SELECT count(*) from table1) as c1, (SELECT count(*)…
Selecting cities that have a combination of products in SQL
I have the following dataset, that have the prices for many products and cities: CREATE TABLE my_table ( the_id varchar(5) NOT NULL, the_date timestamp NOT NULL, the_city varchar(5) NOT …
Only show rows in a table if something changed in previous row
I have a table with a lot of records (6+ million) but most of the rows per ID are all the same. Example: Row Date ID Col1 Col2 Col3 Col4 Col5 1 01-01-2021 1 a b c d e 2 02-01-2021 1 a b c d x 3 03-…
MS Access query that includes a join to itself (using a subquery) and reports values that do not exist (null values)
I have the following table named PRICES: VERTEXID TIMEID PRICE 6001 20191231 104.3 6001 20181231 115.3 6001 20171231 138.3 6001 20161231 122.3 6002 20191231 102.3 6002 20190931 123.3 6002 …
Provide array of ids and get rows with repeated rows
I have the table where I wand to do a query to get same rows multiply times Races Table: id name location 1 fast race London 2 cool race New York 3 super race Berlin I want to do query where I will search races in table by id and get results with repeated rows something like this And get
LIMIT 1 by Column On Query Returning Multiple Results?
I have a user_certifications table, with these props: So, a user can be listed multiple times with a variety of certs. I have a list of user_ids for which I need to get ONLY the most recently updated record. So for one user it would be: How do I do this efficiently if I need ONLY the last dated entry
sql find parent table where sum of child column not equal to parent column
hey guys i am trying to find the a bill from billMaster where the sum of billDetails.total is not equal to billMaster.remainingAmount NB this is a one to many relationship where one bill can contain more billdetails i tried the below query and got an sql error both queries returned the same error i gess its on how i used
Update column value to be minimum of all column values before it
I have a table, which when sorted according to the week number gives the units left of a product at a store. The units left should always be decreasing. However, there are some garbage values due to which the units left in a store increases for few weeks and then decreases again. I just have these four columns to work