There seems to be a bug in my query that causes results to repeat when I increment the OFFSET value. It is supposed to show 20 results per page. Only 3 results match what my query is looking for, but for some reason, some of these results repeat themselves even though they should only appear on the first page of
Tag: subquery
BigQuery – Scalar subquery produced more than one element –
I have this query that helps me to find separate key words within strings (very useful with utm_campaign and utm_content): For example: if I have a umt_campaign like this: us_latam_mkt_google_black-friday_audiencie-custom_NNN-NNN_nnn_trafic_responsiv The query from above will help me to separate each word with a _ in between. So I’ll have a result like this: utm_campaign country product budget source campaign audience
How can I query the results of a MySQL query and get a COUNT() of the results that fall within a certain range?
thanks for taking the time. I have the following query: Which gives me the results I want which are the distinct ‘bike_id'(as there are no duplicates), the count of all the rides each ‘bike_id’ made in 2017, and the quick average for the year for each ‘bike_id’. From here, id like to know if I can have it display the
Mysql Select X rows after specific match
I’m trying to write a select statement in MySQL to get 5 rows after I get my match then sum how many times those numbers were repeated. Example: Raw Table id number 1 1 2 0 3 9 4 14 5 11 6 0 7 3 8 4 9 10 10 9 11 0 12 5 13 3 14 11
How to use Left Join in subquery SQL Server?
I am trying to use left join in subquery in SQL Server. My query looks fine to me but it gives syntax error. This is my query: This is the error I’m getting: This is my table structure: Answer As @Chris mentioned, the query is bit incomplete. I guess you are trying to do something like this: This query worked
How to return results from a subquery greater than a value
I’m trying to find measuring component ids that show up at least 3 times. At this time it is throwing the Oracle Error “ORA-00936: missing expression.” I have tried putting in an existing statement to possibly satisfy the missing expression error, to no avail. It either returned too many values or didn’t bring back any values at all. How do
Subquery to get derived value
I have the below table T in MySQL, with columns A and B. I want to query this table to get a value ‘C’, that has the count of the number of times the value in Column ‘A’ appears in Column ‘B’. For example, 1 appears 2 times in Column B, so the first row of column C should be
How can I get specific rows in a table by the value of a specific queried column of a different table?
I have the Table1 and the Table2 tables. Table1 has the B (Primary Key) and IC columns. Table2 has the CC, SC and IC columns: Table Table1 … B IC … … B1 IC1 … Table Table2 … CC SC IC … … CC1 SC1 IC1 … … CC1 SC2 IC1 … … CC2 SC1 IC1 … … CC2 SC2
Select rowst where ID is on list and meet 2 other requirement, probably subquery in Teradata SQL?
I have table in Teradata SQL like below: And I have list of ID of clients: And I need to select ID of clients from table which are on myList and meet requirements: In col1 value is “A” or “B” In col2 value is bigger than 10 (>10) So as a result I need like below: Because ID = 111
how many banks are currently rated B+ or above and when was the last time (dateindex) that they had been below
I have these two tables and im trying to get the dateindex of the last time that the company was rated below a B+. dateindex=19941 which means 1994 quarter 1 This selects all the companies that have B+ or above in q2 2020 And it yields the following How can I add the dateindex the last time it was below