Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 2 years ago. Improve this question I’d like some help with a code. I have TableA where Btime is sometim…
Tag: sql
Find common value from a column where value from separate column matches 3 different values
Apologies for the poorly worded title. I was not entirely sure how to describe the issue. It’s easier illustrated too me. I have a database table that lists content ids and values. One ID can have different values so id = 1 may have 1 or many rows depending on how many values are associated with it. I w…
Table Aliases into Subqueries
(Submitting here to assist other Snowflake Users who may run into similar challenges… Interested to see if there are any additional recommendations beyond what’s bee provided already.) Why doesn’t table alias work into subqueries? I was using a sample table select query but it doesn’t …
What expression could allow a tuple with NULL attribute to pass
For common expression like a + b > 5, it is obvious that as long as b or a is NULL, the the expression would not be true. In other words, the the null attribute could not pass this expression. However, expression like coalesce could allow a tuple with NULL attribute to pass. For example, coalesce(a,b) >…
Extract substring address SQL
I have a table with column Address which is like city. City_Name, citysector. CitySector, Street. Street_Name, StreetNumber. Street_Number EXAMPLE Address c. Paris, s. ParisDowntown, str. Rue Étienne Marcel, nr. 50 How can I substract 4 different columns like city, sector, street, streetNumber from Address co…
Multiline query execution
I am the Lead Developer on a web-based corporate tax payment application written in C#. My boss asked to develop a script to get him some relevant data from our application. Now he’s asked me to port it to a Desktop Application so he can run the script himself and not have to ask me for the report every…
SQL: Having multiple conditional Averages between two tables
I have two tables Sample from e.g. T1 ———————- ID || Operation Name | ———————-| 101 || QA | ———————- Sample from T 2 ————————-…
SQL count Occurency trouble
I’m pretty new in the SQL world and i have some troubles about counting some row. I explain myself: I have a DB like this: NAME | (somenumbers)| L1 | 2 L1 | 2 L2 | 3 L3 | 1 L3 | 1 L3 | 1 …
Combine Data from Different tables in same SQL Database along with the Table Name
I am trying to get data from Multiple Tables in a same SQL Database along with the Table name from which those are taken from. Select [timestamp] ,[User ID] ,[HCA Location Code] …
How to get entries which are grouped and satisfy restriction within the group?
In the table REPORT there are following 3 columns: RID – report id, which is not unique TYPE – can be either new or cancel, report is identified by RID, so one report can have multiple cancellations …