Merge two sql commands

Asked

Viewed 43 times

-2

Ola would like to join two SQL commands, which are:

SELECT DATE_FORMAT(data_os, '%d/%m/%Y %H:%i') FROM tbos

and:

SELECT* FROM tbos WHERE os = 
  • If possible explain/exemplify your doubt, she is quite confused.

  • What you hope to receive?

1 answer

-3


You can do it like this:

SELECT * FROM 
    (SELECT DATE_FORMAT(data_os, '%d/%m/%Y %H:%i') FROM tbos) as data,
    (SELECT * FROM tbos WHERE os = '') as tudo

As the data are from the same table, so too:

SELECT *, DATE_FORMAT(data_os, '%d/%m/%Y %H:%i') as data FROM tbos WHERE os = ''
  • Because votes against and vote to remove?

Browser other questions tagged

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