astrodestino
IS-IT--Management
Hi!
I am migrating from MSSQL to MySQL and I'm having trouble converting the SQL strings.
I got thins:
That doesnt work so I changed to this:
But something must be wrong, when I open my website I download all the database.
How can I translate the upper sql string to my sql?
tnx!!!!
I am migrating from MSSQL to MySQL and I'm having trouble converting the SQL strings.
I got thins:
Code:
'' strSQL = "SELECT top 1" & strDbTable & "Author.Username, " & strDbTable & "Author.Author_ID, " & strDbTable & "Thread.Topic_ID, " & strDbTable & "Thread.Thread_ID, " & strDbTable & "Thread.Message_date "
'' strSQL = strSQL & "FROM " & strDbTable & "Author, " & strDbTable & "Thread "
'' strSQL = strSQL & "WHERE " & strDbTable & "Author.Author_ID = " & strDbTable & "Thread.Author_ID AND " & strDbTable & "Thread.Topic_ID"' IN "
'' strSQL = strSQL & " (SELECT top 1" & strDbTable & "Topic.Topic_ID "
'' strSQL = strSQL & " FROM " & strDbTable & "Topic "
'' strSQL = strSQL & " WHERE " & strDbTable & "Topic.Forum_ID = " & intForumID & " "
'' strSQL = strSQL & " ORDER BY " & strDbTable & "Topic.Last_entry_date DESC) "
'' strSQL = strSQL & "ORDER BY " & strDbTable & "Thread.Message_date DESC;"
That doesnt work so I changed to this:
Code:
strSQL="SELECT tblAuthor.Username, tblAuthor.Author_ID, tblThread.Author_ID,tblThread.Topic_ID, tblThread.Thread_ID, tblThread.Message_date from tblAuthor, tblThread left Outer Join tblTopic on tblTopic.Forum_ID = tblTopic.Forum_ID WHERE " & strDbTable & "Author.Author_ID = " & strDbTable & "Thread.Author_ID AND " & strDbTable & "Thread.Topic_ID"' Limit 1"
How can I translate the upper sql string to my sql?
tnx!!!!