由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Database版 - SQL Standard
相关主题
有趣的Join问题,源于SQL和SAS比较。Oracle Group and Index question
MS SQL Group By QuestionSQL Server 2008 Exp 怎么export DBF file?
求解释tbl1.col1 = tbl2.col2 (+)
oracle的SQL跟foxpro的SQL相差很大么?SQL 2000 create index 問題
Question on SQL QuerySQL aggregate multiple columns in ACCESS
SQL help!SQL Query 取transaction table 中本周的记录
SQL server Express 怎么加 link tableSQL Server Update Query - non-unique value
请教SQLNeed help on a strange SQL server problem
相关话题的讨论汇总
话题: foxpro话题: sql话题: net话题: server
进入Database版参与讨论
1 (共1页)
a*******t
发帖数: 891
1
I am trying to duplicate a Foxpro program with C#.NET and have some data
result problems. I am not getting the same result from .NET code as from
Foxpro.
Does anyone know if Foxpro (it is currently running on Visual Foxpro 6.0, not
sure in what version of framework it was developed on) use stardard T-SQL?
Anything funny on "JOIN" 's, or anything?
I guess there shouldn't be, but just want to make sure. I should probably look
and compare the SQL statements between the two versions more closely. I
s******n
发帖数: 45
2
Don't know Foxpro. If you post more detail about what you want to accomplish
with .NET code, I think many ppl can help you here.

【在 a*******t 的大作中提到】
: I am trying to duplicate a Foxpro program with C#.NET and have some data
: result problems. I am not getting the same result from .NET code as from
: Foxpro.
: Does anyone know if Foxpro (it is currently running on Visual Foxpro 6.0, not
: sure in what version of framework it was developed on) use stardard T-SQL?
: Anything funny on "JOIN" 's, or anything?
: I guess there shouldn't be, but just want to make sure. I should probably look
: and compare the SQL statements between the two versions more closely. I

a*******t
发帖数: 891
3
after some headache, I found there are at least two strange (or by design)
behaviors in FoxPro.
1. the following statement runs in FoxPro, but not in SQL Server
select ID, sum(charges), invoiceDate
from tableA
group by ID
what FoxPro does is execute this as max(invoiceDate), while SQL Server refuses
to run the statement unless I put in the "max".
2. this statement runs in both FP and SQL Server, but with different results.
select ID, invoiceDate
from tableA
where ID not in (select ID from tableA

【在 s******n 的大作中提到】
: Don't know Foxpro. If you post more detail about what you want to accomplish
: with .NET code, I think many ppl can help you here.

s******n
发帖数: 45
4
1. SQL Server is doing the right thing, you either need to have invoiceDate
in the "group by " list or you need to specify an aggregation operator such
as AVG, MAX, etc.
2. The query itself seems ridiculous. If I understand it right, it is the
same as follows:
select ID, invoiceDate from tableA where invoiceDate >= '2005-1-1'
Do u know the original purpose of this query?

【在 a*******t 的大作中提到】
: after some headache, I found there are at least two strange (or by design)
: behaviors in FoxPro.
: 1. the following statement runs in FoxPro, but not in SQL Server
: select ID, sum(charges), invoiceDate
: from tableA
: group by ID
: what FoxPro does is execute this as max(invoiceDate), while SQL Server refuses
: to run the statement unless I put in the "max".
: 2. this statement runs in both FP and SQL Server, but with different results.
: select ID, invoiceDate

a*******t
发帖数: 891
5
I had to simplify/fix a lot of queries like those. not sure why they were
written that way before. might be the develper did too much cut and paste and
never went back to clean up the code since it worked in foxpro.

refuses
results.
but
accomplish

【在 s******n 的大作中提到】
: 1. SQL Server is doing the right thing, you either need to have invoiceDate
: in the "group by " list or you need to specify an aggregation operator such
: as AVG, MAX, etc.
: 2. The query itself seems ridiculous. If I understand it right, it is the
: same as follows:
: select ID, invoiceDate from tableA where invoiceDate >= '2005-1-1'
: Do u know the original purpose of this query?

1 (共1页)
进入Database版参与讨论
相关主题
Need help on a strange SQL server problemQuestion on SQL Query
SQL Query QuestionSQL help!
中年大叔跪求这里的高人大虾指点 delphi设计的出路SQL server Express 怎么加 link table
how to particially delete record in sql server请教SQL
有趣的Join问题,源于SQL和SAS比较。Oracle Group and Index question
MS SQL Group By QuestionSQL Server 2008 Exp 怎么export DBF file?
求解释tbl1.col1 = tbl2.col2 (+)
oracle的SQL跟foxpro的SQL相差很大么?SQL 2000 create index 問題
相关话题的讨论汇总
话题: foxpro话题: sql话题: net话题: server