Assistance needed on query
Sims, John (CDC/CCHP/NCBDDD) (CTR)
ayu8 at CDC.GOV
Mon May 14 08:02:47 CDT 2007
> -----Original Message-----
> From: valentina-bounces at lists.macserve.net
> [mailto:valentina-bounces at lists.macserve.net] On Behalf Of
> Ruslan Zasukhin
> Sent: Monday, May 14, 2007 8:43 AM
> To: valentina at lists.macserve.net
> Subject: Re: Assistance needed on query
>
> On 14/5/07 1:43 PM, "Bart Pietercil" <bart.pietercil at gmail.com> wrote:
>
> >> SELECT competence_cards.recid, '' AS 'mycompetenceid',
> >> ^^^^^
> >> what Is this ?
> >
> > That would be the table name. Since I am using a join I
> have 2 tables
> > with recids and I suppose I need to fully qualify them in order to
> > specify which of the two I want ?
>
> Don't understand.
>
> Can be
>
> SELECT f1
> SELECT f1 as 'alias'
> SELECT expr as 'alias'
>
> But you have
>
> select '' as 'alias'
>
> What means EMPTY single quotes?
>
>
> --
> Best regards,
>
> Ruslan Zasukhin
> VP Engineering and New Technology
> Paradigma Software, Inc
>
Hi Ruslan,
I've seen this trick before. For many databases, this gives you a
column of "blanks", or other "default" values. We used to use this
trick for binding the datatable (cursor) to a datagrid when we wanted to
include columns that had nothing to do with the database.
For example:
Select FirstName, LastName, Address, City, State, Zip, TRUE as
'PrintNow' FROM Addresses
Now, when you get the datatable, you bind it to the grid and have a
"PrintNow" column with each line set to TRUE by default. We would never
store the "PrintNow" data in the database and this way you didn't have
to modify the datatable after the results were returned from the
database just to add the "PrintNow" column. Having the "PrintNow"
column in the datatable made it easier to pass this information to
related processes.
I hope I made sense.
-John
More information about the Valentina
mailing list