Helpful Information
 
 
Category: Other Databases
SQL-question that wont work but is correct?

:mad:
I put up a survey for this thing I have to do to get my masters (education).
The problem is that I get a "type-mixing" error. The SQL-question is:
SELECT 9 FROM Survey WHERE 9 = '2'
Now the thing is that since the survey is standardized the fields are called
1-46 but it seems that SQL think it's a number bcs if I put 's around the 9 after the WHERE it runs or remove the 's around the 2. But that is not what I'am asking the DB for.
Anyone?

--------
I think I solved it myself :). Somewhere I rembered using ['s and it seem to work.

Be more specific in what you are asking for by specifying the table name aswell.

SELECT Survey.9 FROM Survey WHERE Survey.9 = 2

You only need to add the apostrophes to the 2 if the datatype is text and not integer.










privacy (GDPR)