Skip to content

How to get the ID’s of duplicates rows in a table

I want to get the IDs of rows with the same name in a Table. Here is an example of my table, I want to get ALL the IDs of the duplicates names of id n°1. Here are the duplicates value of id n°1 : 1, 3 and 4. Now this is what I want to have: Thank you 🙂

Building Subquery to be a column/Field Name

I am unable to bundled groups of subqueries correctly in order to create column titled “Discharge_To” I am using Teradata Studio Express. I was asked to create a column for field that is not inside a …

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 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 …