Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM SQL » View Thread |
Messages 1 to 7 of 7 total |
Insert a new Column using SELECT |
Fri, Jan 20 2006 6:28 AM | Permanent Link |
"Jack Marsh" | Hi,
I have a simple query that creates a table using SELECT ContactCode, ContactName FROM Contacts I would like the results table to insert an additional boolean column, with every record defaulting to 'True'. Is this possible and, if so, how? Thanks Jack |
Fri, Jan 20 2006 6:41 AM | Permanent Link |
"Ole Willy Tuv" | Jack,
<< I have a simple query that creates a table using SELECT ContactCode, ContactName FROM Contacts >> You mean creates a result set ? << I would like the results table to insert an additional boolean column, with every record defaulting to 'True'. >> SELECT ContactCode, ContactName, CAST('True' AS BOOLEAN) FROM Contacts Ole Willy Tuv |
Fri, Jan 20 2006 6:54 AM | Permanent Link |
"Ole Willy Tuv" | I didn't think of it at first, but you can also use the boolean literal
True: SELECT ContactCode, ContactName, True FROM Contacts Ole Willy Tuv |
Fri, Jan 20 2006 8:01 AM | Permanent Link |
"Robert" | "Ole Willy Tuv" <owtuv@online.no> wrote in message news:E6DE4EC1-86A4-45EE-BFAB-6DC9F448E801@news.elevatesoft.com... > > SELECT > ContactCode, > ContactName, > CAST('True' AS BOOLEAN) MyField you will need a name for the field. Robert |
Fri, Jan 20 2006 8:28 AM | Permanent Link |
"Jack Marsh" | Thanks guys, works a treat!
Cheers, Jack "Ole Willy Tuv" <owtuv@online.no> wrote in message news:E6DE4EC1-86A4-45EE-BFAB-6DC9F448E801@news.elevatesoft.com... > Jack, > > << I have a simple query that creates a table using > > SELECT ContactCode, ContactName FROM Contacts >> > > You mean creates a result set ? > > << I would like the results table to insert an additional boolean column, > with every record defaulting to 'True'. >> > > SELECT > ContactCode, > ContactName, > CAST('True' AS BOOLEAN) > FROM Contacts > > Ole Willy Tuv > > |
Fri, Jan 20 2006 8:50 AM | Permanent Link |
"Ole Willy Tuv" | > you will need a name for the field.
Why ? Ole |
Fri, Jan 20 2006 9:18 AM | Permanent Link |
"Robert" | "Ole Willy Tuv" <owtuv@online.no> wrote in message news:65DE3F0D-BA68-4BA3-9948-4542AD7401EF@news.elevatesoft.com... > > you will need a name for the field. > > Why ? > Well, I think it is better to name the field. You don't HAVE to. Robert > Ole > > |
This web page was last updated on Saturday, May 4, 2024 at 12:54 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |