Skip to content

Tag: select

SQL CASE Expression

I need to write a sql statement(Oracle) where I can withdraw data from two diff tables and check for a condition and return a certain string. My statement goes like this, When I run this I get a error: “FROM keyword not found where expected”and points to the c in line 2. and if I change the from t…

SQL Select after character /

I’d like to select everything AFTER a certain character (/) that is placed on the most right side. I’v in CSV_COL(3) this text 200/100 or 50/10 ot 10/5 etc.. and i need to uso only number to the …

Conditional Query Using “AS” field

Above you can see my code. It is currently returning exactly the output I want when you remove the “WHERE” function. I’m adding the “WHERE” function and attempting to access the new column I made called “NPO”. It seems as if the column does not exist to the SQL editor…

Mysql Left join index

I used the following query To display items from two tables, where the id of the first table is the item_id of the second. My question is , when I try to display this in php , if I want to display a.id i can try with: or since both tables have id,on the first example displays only if there

Multiple SUM in one query with multiple where

I’m trying to write a SQL query that produces a table with summarized values for each year and month. I have a table that looks something like this: And another table that looks like this: I want to have a query that returns the sum for each month like this: Explanation of the output: Year and Month are…