pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedConversion Problem
3+ messages / 3 participants
[nested] [flat]
* Conversion Problem
@ 2003-11-13 12:25 Graham <graham@digitalplanit.com>
0 siblings, 2 replies; 3+ messages in thread
From: Graham @ 2003-11-13 12:25 UTC (permalink / raw)
To: pgsql-sql
Apologies as this probably isn't really for this list but...
In postgresql you can execute a statement such as:
SELECT 1 > 2;
And it would return 'f'
Does anyone know if you can do this in SQL Server as I have to do a
conversion of some prewritten SQL code.
MTIA,
Graham.
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Conversion Problem
@ 2003-11-13 14:40 Richard Huxton <dev@archonet.com>
parent: Graham <graham@digitalplanit.com>
1 sibling, 0 replies; 3+ messages in thread
From: Richard Huxton @ 2003-11-13 14:40 UTC (permalink / raw)
To: Graham <graham@digitalplanit.com>; pgsql-sql
On Thursday 13 November 2003 12:25, Graham wrote:
> Apologies as this probably isn't really for this list but...
>
> In postgresql you can execute a statement such as:
>
> SELECT 1 > 2;
>
> And it would return 'f'
>
> Does anyone know if you can do this in SQL Server as I have to do a
> conversion of some prewritten SQL code.
If you look here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_oa-oz_3qpf.asp
"Unlike other SQL Server data types, a Boolean data type cannot be specified
as the data type of a table column or variable, and cannot be returned in a
result set."
Generally you'd use a BIT type instead of a boolean, but that's not going to
help you here. I'm not even sure if you can use a boolean expression in the
column-list part of a select.
The only thing I can think of is to use a case:
SELECT WHEN 1>2 THEN 1 ELSE 0 END;
As to why MSSQL doesn't support booleans, you could try asking their tech
support, but I wouldn't get your hopes up.
--
Richard Huxton
Archonet Ltd
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Conversion Problem
@ 2003-11-13 15:06 Christoph Haller <ch@rodos.fzk.de>
parent: Graham <graham@digitalplanit.com>
1 sibling, 0 replies; 3+ messages in thread
From: Christoph Haller @ 2003-11-13 15:06 UTC (permalink / raw)
To: graham@digitalplanit.com; +Cc: pgsql-sql
>
> Apologies as this probably isn't really for this list but...
Right.
>
> In postgresql you can execute a statement such as:
>
> SELECT 1 > 2;
>
> And it would return 'f'
>
> Does anyone know if you can do this in SQL Server as I have to do a
> conversion of some prewritten SQL code.
No, I don't know. Can't you simply try?
>
> MTIA,
>
> Graham.
>
>
Regards, Christoph
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2003-11-13 15:06 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-11-13 12:25 Conversion Problem Graham <graham@digitalplanit.com>
2003-11-13 14:40 ` Richard Huxton <dev@archonet.com>
2003-11-13 15:06 ` Christoph Haller <ch@rodos.fzk.de>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox