Skip to content

Instantly share code, notes, and snippets.

@jgdoncel
Created October 2, 2013 13:52
Show Gist options
  • Save jgdoncel/6794152 to your computer and use it in GitHub Desktop.
Save jgdoncel/6794152 to your computer and use it in GitHub Desktop.
IF en subconsulta Ejemplo de uso de una condición IF con una subconsulta en su interior
SELECT DISTINCT files.contentType, IF ((SELECT COUNT(id) FROM files_favoritos)=0,'si','no') FROM files
@ddiazr3
Copy link

ddiazr3 commented Nov 29, 2019

SELECT DISTINCT files.contentType, IF ((SELECT COUNT(id) FROM files_favoritos)=0,'si','no') FROM files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment