I like to know with a CASE statement wether two fields are the same. I managed to do it with following query but I wonder if there is a better approach? I just want the ‘=’ to do a case sensitive …
Tag: case
How to get value from a query of another table to create a new column (postgresql)
I am new to postgres and I want to be able to set value to Y if order (order table) is a first month order (first month order table) first month order table is as per below. It will only show the order placed by user the first time in the month: order table is as per below. It shows
Using CASE with Table Join
I am using Oracle 11g. I have two tables: I want to display student_name, course, fee and a column with discounted fee where the fee is reduced by 10% if it is either ‘BIT’ or ‘MIT’. I’ve come up with following query but it gives an error: ORA-00923: FROM keyword not found where expected: Answer You can use decode as
calculating percentiles in aws athena
result of my query is being used in aws quicksight. even though quicksight offers percentileCont() which does the job for us I want to use it in the query instead of using calculated field. eventually what I want to do is create a point column where depending on a column that ranges from [a, b]. Right now I find out
SQL: Change the value of a column in function of another
I get a table from SQL that I put whitin a winform’s datagridview. I just want to change the value of my last column in funtion of another. Here is the example: I have 4 columns : ID / Price / …
Is there the ability for SQL to take a value, use logic, and result a different value
This may be a silly question, but I’m trying to essentially take a value that’s in a field and IF contains “Tele” THEN result Televideo. Or it might be better: IF other than “Office&…
Adding a new column to an existing table based on the contents of two preexisting columns
I am trying to add a new column to an existing table in SQL Server. I want this new column’s value to be determined based on the contents of two existing columns within the table. For example there is one column called manufacturer and another called Vendor. When the contents of these two columns are the same I would like
Case expression with Boolean from PostgreSQL to SQL Server
I am translating a query from PostgreSQL to SQL Server. I didn’t write the query in PostgreSQL and it’s quite complicated for my knowledge so i don’t understand every piece of it. From my understand: …
query to insert records to another table by calculating the percentage on a column
I have 2 Postgres tables with the following structure: Lets say I have data in the tmp table as below: I have a script below that inserts the data from public.tmp to public.mo table based on the criteria that if the column STATUS has mix values (COMPLIANT and NC) for a particular HOSTNAME then compliant_status is PARTIAL and if all
How i want make 3 rows of the same primary key into 1 row by checking and choose its value using case
For example here, from this table key | status 1001 | A 1001 | D 1001 | C the hierarchy will be C>D>A If the the stats contain C as the value, the person status will become C in one row. …