Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
teste sql
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
create table tabela (saldo int); create table tabela2 (outracondicao varchar(255)); insert into tabela(saldo) values (10),(0),(15),(12),(0); insert into tabela2 (outracondicao) values ('nada'); --teste 1 SELECT 'select numero 1', * FROM tabela AS t WHERE (t.saldo = 0 AND EXISTS (SELECT 1 FROM tabela2 AS t2 WHERE t2.outracondicao = 'condicao')) --teste 2 IF EXISTS (SELECT 1 FROM tabela2 AS t2 WHERE t2.outracondicao = 'condicao') BEGIN SELECT 'select numero 2', * FROM tabela AS t WHERE t.saldo = 0 END insert into tabela2 (outracondicao) values ('condicao'); --teste 1 SELECT 'select numero 3', * FROM tabela AS t WHERE (t.saldo = 0 AND EXISTS (SELECT 1 FROM tabela2 AS t2 WHERE t2.outracondicao = 'condicao')) --teste 2 IF EXISTS (SELECT 1 FROM tabela2 AS t2 WHERE t2.outracondicao = 'condicao') BEGIN SELECT 'select numero 4', * FROM tabela AS t WHERE t.saldo = 0 END
View schema
Execution time: 0,03 sec, rows selected: 4, rows affected: 7, absolute service time: 0,19 sec
edit mode
|
history
(No column name)
saldo
1
select numero 3
0
2
select numero 3
0
(No column name)
saldo
1
select numero 4
0
2
select numero 4
0