Change value of FALSE TRUE column

Asked

Viewed 39 times

-3

I have a Postgresql database and need to change the table Produto with the column Permite_venda. The items are with FALSE and I need to move on to TRUE

How should I do?

I list all below:

select * from produto where permite_venda = 'f';

And how do I update?

2 answers

0


Dear,

The syntax is UPDATE [table] SET [field] = [value] WHERE = [criteria];

Below how it would look (whereas the 'Boolean' you say is the value’t')

    update produto set permite_venda = 't' where permite_venda = 'f';
  • Thank you very much solved my problem

  • Please, we are here to help. By the way, I ask you to mark the answer as accepted. Hug.

  • Mark me another help I’ll make one . bat Mounted here but it didn’t work out can see what I did wrong C: Program Files (x86) Postgresql 9.2 bin set PGUSER=postgres set PGPASSWORD=a011 setPG=localhost set PGDATABASE=autosystem update product set permite_sell = ’t' Where permite_sell = 'f';

  • In that case, try another question. I can tell you that I’ve never done this kind of procedure, but it’s worth a try, only around here, we can’t put the code properly.

  • Quiet... Thank you for your attention

-1

Just follow this scheme:

UPDATE table_name
SET column1 = value1,
    column2 = value2,
    ...
WHERE condition;

In your case:

Update Produto SET Permite_venda = 'true' WHERE id = <id do produto>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.