Skip to content

How to exclude certain entries from a query [SQL]

I do have the following issue: Let’s say you have a table that looks like this: Question: I want to have an query which will deliver all the NotPrimID’s which do have the Number as 13, however if the Number of a NotPrimID is also 14 etc. it should be automatically excluded from the list. Answer Yo…

Covert Access Cross tab to sql

I need this converted to a SQL view. This is the code from MS Access: Any ideas how to re write this into SQL ? In products I have id, BelsCategoryID. In Categories, I have ID. In Sold, I have BelsProductID and year. – This table shows weather a product is sold in a given year. I want the result

TSQL Two different tables, 800GB vs 2GB Find common

I have two tables, generatedblock table, and addresses table The generatedblock table has a column called expandedblock block. The addresses table has a column called address. What I need to do is find if in the generatedblock table there is a value in the addresses table. I have tried failed code but I am no…

Custom sorting in oracle

I am trying to sort a particular column “TENOR” on the basis on maturity (group by Currencies) for eg – it should be sorted in the following order ON, SW, 1M, 2M, 3M, 6M, 9M, 1Y, 18M, 2Y and so on.. where ON = Overnight, SW = Single week and 1M = 1 month. i have tried using order by