本文介绍了Select Statement的问题〜有人可以帮忙吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello All,


我有这个sql语句,当我调用一个函数时它在MSSQL中工作


函数showNewProd(dispNum)


''声明一些变量

dim mySQL,rsTemp,tempStr,count


''读取数据库

mySQL =" SELECT TOP" &安培;差异与分析" idProduct,description" _

& FROM products _

& WHERE active = -1; _

& ORDER BY idProduct DESC

set rsTemp = openRSexecute(mySQL)

do while while rsTemp.EOF


' '增量计数器

count = count + 1


''构建显示字符串

tempStr = tempStr _

&数数与数量" ;. < a href =""" &安培; urlNonSSL _

& " prodView.asp idProduct = QUOT; &安培; rsTemp(" idProduct")& """>" _

& rstemp(" description")_

& "< / a>< br>"


''下一个记录

rsTemp.MoveNext


循环

调用closeRS(rsTemp)

结束函数

我需要使用与mysql数据库相同的函数,我b / b
有问题可能是SELECT TOP语句,没有工作

与MYSQL,但我不知道如何解决这个问题,任何人都可以提供帮助我是一个

有点卡住了。


非常感谢提前。

Andie

Hello All,

I have this sql statement thats works in MSSQL when I call a function

function showNewProd(dispNum)

''Declare some variables
dim mySQL, rsTemp, tempStr, count

''Read Database
mySQL="SELECT TOP " & dispNum & " idProduct, description " _
& "FROM products " _
& "WHERE active = -1 " _
& "ORDER BY idProduct DESC "
set rsTemp = openRSexecute(mySQL)
do while not rsTemp.EOF

''Increment counter
count = count + 1

''Build display string
tempStr = tempStr _
& count & ". <a href=""" & urlNonSSL _
& "prodView.asp?idProduct=" & rsTemp("idProduct") & """>" _
& rstemp("description") _
& "</a><br>"

''Next Record
rsTemp.MoveNext

loop
call closeRS(rsTemp)

end function
I need to make the same function work with a mysql database, the problem I
am having is a problem with possibly the SELECT TOP statement, not working
with MYSQL but I am not sure how to fix this, can anyone help as I am a
little stuck.

Many thanks in advance.
Andie

推荐答案




SELECT TOP有什么作用? (或者它应该在MySQL中做什么?)



What does SELECT TOP do? ( Or what it is supposed to do in MySQL? )





SELECT TOP有什么作用? (或者它应该在MySQL中做什么?)



What does SELECT TOP do? ( Or what it is supposed to do in MySQL? )



这篇关于Select Statement的问题〜有人可以帮忙吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-12 01:09