SQLite Forum

Using an alias in queries
Login
Yes.

Do not confuse an Alias for a Variable.

If I say "Here is a tree, let's call him John" and then say "How tall is John?" one might get an answer of 25 meters.
If I then say "Here is a cricket, let's call him John" and again ask "How tall is John?" I might now get an answer in millimeters. 
The word "John" carried no value in any circumstance. It is merely a pointer/label to a thing with value and it only points/labels correctly while in scope (duration of query in the case of SQL).

Other than this, the reason I think nobody is answering your question is that none of us really understand what you mean. (I should speak for myself of course, perhaps loads of clever people here know exactly what you are asking).

For me though, your code seems to hang together loosely and I don't know what you mean by "CL". Also we don't really speak "web".

Is there a way for you to make an SQL query (perhaps a schema and query) that demonstrates your problem so we do not have to spend hours guessing and recreating your code?
If it's a query that doesn't work, the problem is with SQLite. If it's code that doesn't work (even when involving a query), it's likely the fault is with your code or the wrapper you use.

We can mostly only help with SQLite Query problems. Code/Wrapper problems should be directed to their respective forums, and to know whether it is a SQL error or not, we need to see a query/schema that doesn't work.