Home > database >  Select statements contained in the variable (field)
Select statements contained in the variable (field)

Time:10-06

I now use a mysql database, SQL server link
Write a statement, meet with difficulties, please give directions, statements are as follows:
SELECT * FROM OPENQUERY (MYSQL, 'SELECT * FROM table')
Select a, b, c=(select * FROM OPENQUERY (MYSQL, 'select count (*) FROM the table where d=t1. A')) FROM table1 t1
This is the "where d=t1. A" I don't know how to write, is always an error,
I tried, where a='t1. A' where a='ta. A' 'where a=' "t1. A '"

CodePudding user response:

The structure of the table send it and see

CodePudding user response:

reference 1st floor hongmei85 response:
table look the structure of the hair ah

Table structure is too complex, in fact just want to know when the format of the reference variable statement should be how to write

CodePudding user response:

Spell in variable directly, can't pass parameter
Or do you use sp_executesql and put the query results in a temporary table, this can pass parameters, but not directly query
  • Related