SQL :
SELECT Table1.FieldA, CONCAT(Table1.FieldB,TABLE2.FieldC) AS FieldD
FROM Table1 LEFT JOIN Table2.....
Is it possible to get back CONCAT(Table1.FieldB,TABLE2.FieldC) from TMyQuery or TField of FieldD?
In TField, FieldD FieldName is of cause FieldD but the origin is also FieldD.
I would like the original expression (base on user choice of filters etc) to create another SQL with Where or so.
Thanks you!
Is is possible to get the field expression from TMyQuery?
-
AndreyZ
Hello,
The point is that when you use alias, MySQL returns alias for both field name and field original name. You can change your SQL code basing on your users' choice. Here is an example:
The point is that when you use alias, MySQL returns alias for both field name and field original name. You can change your SQL code basing on your users' choice. Here is an example:
Code: Select all
SELECT Table1.FieldA, CONCAT(Table1.FieldB,TABLE2.FieldC) AS FieldD
FROM Table1 LEFT JOIN Table2.....
SELECT Table1.FieldA, CONCAT(Table1.FieldB,TABLE2.FieldC)
FROM Table1 LEFT JOIN Table2.....
or
SELECT Table1.FieldA, CONCAT(Table1.FieldB,TABLE2.FieldC) AS 'CONCAT(Table1.FieldB,TABLE2.FieldC)'
FROM Table1 LEFT JOIN Table2.....