Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

change of value at the time of insertion

1 réponse
Avatar
lucky
Hai,
Here is a query that i am creating a table

create table test10 (item varchar(10),state bit)


now at the time of insertion i will enter like this


insert into test10 values ('book' ,1)


but at the time of display in the table i want


item state
book true


from above i want to ask that when i am going to insert 1 i want to
get true and 0 as false.I never enter true or false in the insert
command. please help me in coding and with an example.
thankyou,
lucky.

1 réponse

Avatar
Philippe T [MS]
Bonjour,

This is a french newsgroup !!!

Why do you want to display true / false ? You can do that when you retreive
your data from the table :

SELECT item, CASE state WHEN 1 THEN 'True' ELSE 'False' END AS state

----------------------------------------------------------------------
Philippe TROTIN - Microsoft Service France

"lucky" wrote in message
news:
Hai,
Here is a query that i am creating a table

create table test10 (item varchar(10),state bit)


now at the time of insertion i will enter like this


insert into test10 values ('book' ,1)


but at the time of display in the table i want


item state
book true


from above i want to ask that when i am going to insert 1 i want to
get true and 0 as false.I never enter true or false in the insert
command. please help me in coding and with an example.
thankyou,
lucky.