Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 2 days ago.
This post was edited and submitted for review 2 days ago.
Improve this question
SQL Newbie here ...
Service_plan table has a record per customer with PKEY service_plan_id
SERVICE_PLAN_ID table keeps track of version changes with same PKEY
When I run this query [other selects omitted for brevity] in Oracle 10.2.0 iSQL command line, I get an error:
select S1.service_plan_id as TN,V1.VERSION_ID as Version
from Service_plan S1
inner join
(select distinct service_plan_id, max(VERSION_ID)
from SERVICE_PLAN_VERSION
where service_ID='COLL'
group by service_plan_id) as V1
on V1.SERVICE_PLAN_ID = S1.SERVICE_PLAN_ID
where S1.SERVICE_ID='COLL';
Error: missing key word on the "group by service_plan_id) as V1" line - it points to the "as" as the problem.
Any thoughts? Thx
Tried the standalone select and it works fine
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 9 days ago.
Improve this question
SELECT AgentData.AgentLoginID,AgentData.KPIName,Minimum.Indicator,Minimum.PMonth,Minimum.PYear,Minimum.Min,
IIf(InStr([AgentData].[Goal],'%')>0,(Left([AgentData].[Goal],Len([AgentData].[Goal])-1)/100),[AgentData].[Goal]) AS Goal,
AgentData.Weightage,
Round(IIf(InStr([AgentData].GoalValue,'%')>0,(Left([AgentData].GoalValue,Len([AgentData].GoalValue)-1)/100),[AgentData].GoalValue),2) AS GoalValue,
Round(IIf([Minimum].[Indicator]='P',(IIf([Goal]=0,Null,[GoalValue]/[Goal]),IIf(([Minimum].[Indicator]='N' And ([Minimum].[Min]=0 Or [Minimum].[Min]=(format(0,"Percent")),Null,([Minimum].[Min]-[GoalValue]/[Minimum].[Min]),4) AS [Value],
Round([AgentData].Weightage*Value,4) AS Product FROM Minimum INNER JOIN AgentData ON Minimum.KPIName = AgentData.KPIName;
I have been trying to execute this code in access, but no success, i keep getting a syntax error, missing operator in expression, but unable to figure out what the issue is, so wondering if anyone could help, i get an error with the SQL statement marked in bold
SELECT AgentData.AgentLoginID, AgentData.KPIName, Minimum.Indicator, Minimum.PMonth, Minimum.PYear, Minimum.Min,
IIf(InStr([AgentData].[Goal],'%')>0,(Left([AgentData].[Goal],Len([AgentData].[Goal])-1)/100),[AgentData].[Goal]) AS Goal,
AgentData.Weightage,
Round(IIf(InStr([AgentData].GoalValue,'%')>0,(Left([AgentData].GoalValue,Len([AgentData].GoalValue)-1)/100),[AgentData].GoalValue),2) AS GoalValue, Round(IIf([Minimum].[Indicator]='P',IIf([Goal]=0,Null,[GoalValue]/[Goal]),
IIf(([Minimum].[Indicator]='N' And [Minimum].[Min]=0),Null,([Minimum].[Min]-[GoalValue])/[Minimum].[Min])),4) AS [Value],
Round([AgentData].Weightage*Value,4) AS Product
FROM Minimum INNER JOIN AgentData ON Minimum.KPIName = AgentData.KPIName;
The above query runs perfectly fine, but i get a snytax errors when i add the OR operator for Minimum.Min as i want it to exectue in two scenarios , one is when Minmum.min is 0 or when minimum.min = 0%
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 3 years ago.
Improve this question
I am trying to run the query below but I am getting an error ERROR: column "test.pdf" does not exist . I dont know why I am getting this error. I search for various links on stackover but none solved my problem like this PostgreSQL query -- column does not exist, Postgres error updating column data. Please help me find the problem.
bill is a type string field in bills table.
update bills
set bill = "test.pdf"
where id=3;
Change the double quotes you have around test.pdf to single quotes.
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 5 years ago.
Improve this question
When I do a select * over the table, the column Qty & QtyPending show a value of 6. However explicitly selecting the column names shows different values. Can anyone shed some light as to why this behavior is occurring?
This is a legacy system and database used is SQL Server 2000. The column data types are smallint.
So I have explicitly updated QtyPending to 6 using an Update query. This column now shows correct value.
Also added locstockid to the query, column Qty still shows different values.
Whatever I see in the image provided both the query have different LocStockId which means they can have different values
First :
LocStockId = 152319
Second :
LocStockId = 153219
I think you have mistyped.
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 7 years ago.
Improve this question
I am trying to write an SQL code in MS Access 2010 as follows:-
select WOWPerformanceData_tbl.Style,
WOWPerformanceData_tbl.FY,
WOWPerformanceData_tbl.Month,
PrintPromotions.[Type of Offer],
PrintPromotions.Start,
PrintPromotions.End
from WOWPerformanceData_tbl
right join PrintPromtions
on WOWPerformanceData_tbl.Style=PrintPromotions.Style
where (WOWPerformanceData_tbl.Style=[Enter Style nr:]);
Upon running the code, Access returns an error in the join operation pointing to the fourth line and selects PrintPromotions
Any feedback will be appreciated..
Thank you.
Should that be PrintPromotions and not PrintPromtions ?
This is fine as the where clause is an evaluation on the entire set.
SELECT WOWPerformanceData_tbl.Style,
WOWPerformanceData_tbl.FY,
WOWPerformanceData_tbl.Month,
PrintPromotions.[Type of Offer],
PrintPromotions.Start,
PrintPromotions.End
from WOWPerformanceData_tbl
LEFT join PrintPromtions
on WOWPerformanceData_tbl.Style=PrintPromotions.Style
where (WOWPerformanceData_tbl.Style=[Enter Style nr:]);
This would exclude records from printPromotions that were not in wowPerformanceData_tbl, which negates the right join.:
SELECT WOWPerformanceData_tbl.Style,
WOWPerformanceData_tbl.FY,
WOWPerformanceData_tbl.Month,
PrintPromotions.[Type of Offer],
PrintPromotions.Start,
PrintPromotions.End
from WOWPerformanceData_tbl
right join PrintPromtions
on WOWPerformanceData_tbl.Style=PrintPromotions.Style
where (WOWPerformanceData_tbl.Style=[Enter Style nr:]);
This is how you would do it to keep all records from PrintPromotions and those that matched in wowperofrmanceData_tbl.
SELECT WOWPerformanceData_tbl.Style,
WOWPerformanceData_tbl.FY,
WOWPerformanceData_tbl.Month,
PrintPromotions.[Type of Offer],
PrintPromotions.Start,
PrintPromotions.End
from WOWPerformanceData_tbl
right join PrintPromtions
on WOWPerformanceData_tbl.Style=PrintPromotions.Style
AND (WOWPerformanceData_tbl.Style=[Enter Style nr:]);