Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Hi, Steve,
I may have misstated this but am too lazy to check. You are right that one cannot put quotes around the field names but one can put them around field alias names e.g.
SELECT field AS "field_alias" FROM table
In addition, one can put quotes around the table name.
Why one would want to do this I cannot say. I certainly don't do it. I just found it interesting and loosely relevant to the topic that I recently helped somebody with a query where the query had these quotes and actually worked to my surprise.
>Hello Greg,
>
>Well, I tried to put quotes around the field names, and I get a syntax error.
>
>As it turns out, he is not trying to get VFP data...I guess he is trying to put this SELECT into a string and use ODBC.
>
>>Interestingly, I ran across somebody putting quotes around field alias names. I am guessing this is done in some other product's SQL statements. Much to my surprise, it worked. In VFP -- based on minimal testing purely out of curiousity that these statements worked -- quotes around a field alias or table name will work.
>>
>>
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement