Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
42f7cb70
Commit
42f7cb70
authored
Oct 10, 2006
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new DQL docs
parent
59576225
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
91 additions
and
2 deletions
+91
-2
DQL (Doctrine Query Language) - Conditional expressions - Exists Expressions.php
...guage) - Conditional expressions - Exists Expressions.php
+26
-0
DQL (Doctrine Query Language) - Conditional expressions - In expressions.php
... Language) - Conditional expressions - In expressions.php
+4
-2
DQL (Doctrine Query Language) - Conditional expressions - Literals.php
... Query Language) - Conditional expressions - Literals.php
+50
-0
DQL (Doctrine Query Language) - Conditional expressions - Subqueries.php
...uery Language) - Conditional expressions - Subqueries.php
+11
-0
No files found.
manual/docs/DQL (Doctrine Query Language) - Conditional expressions - Exists Expressions.php
0 → 100644
View file @
42f7cb70
Syntax
:
<
div
class
='
sql
'>
<pre>
<i>operand</i> [NOT ]EXISTS (<i>subquery</i>)
</pre>
</div>
The EXISTS operator returns TRUE if the subquery returns one or more rows and FALSE otherwise. <br \>
<br \>
The NOT EXISTS operator returns TRUE if the subquery returns 0 rows and FALSE otherwise.<br \>
<br \>
Finding all articles which have readers:
<div class='
sql
'>
<pre>
FROM Article
WHERE EXISTS (FROM ReaderLog(id)
WHERE ReaderLog.article_id = Article.id)
</pre>
</div>
Finding all articles which don'
t
have
readers
:
<
div
class
='
sql
'
>
<
pre
>
FROM
Article
WHERE
NOT
EXISTS
(
FROM
ReaderLog
(
id
)
WHERE
ReaderLog
.
article_id
=
Article
.
id
)
</
pre
>
</
div
>
manual/docs/DQL (Doctrine Query Language) - Conditional expressions - In expressions.php
View file @
42f7cb70
Syntax
:
Syntax
:
<
div
class
='
sql
'>
<
div
class
='
sql
'>
<pre>
<pre>
<i>operand</i> IN (<i>subquery</i>|<i>valuelist</i>)
<i>operand</i> IN (<i>subquery</i>|<i>value
list</i>)
</pre>
</pre>
</div>
</div>
An IN conditional expression returns true if the <i>operand</i> is found from result of the <i>subquery</i>
An IN conditional expression returns true if the <i>operand</i> is found from result of the <i>subquery</i>
or if its in the specificied comma separated <i>valuelist</i>, hence the IN expression is always false if the result of the subquery
or if its in the specificied comma separated <i>value
list</i>, hence the IN expression is always false if the result of the subquery
is empty.
is empty.
When <i>value list</i> is being used there must be at least one element in that list.
<div class='
sql
'>
<div class='
sql
'>
<pre>
<pre>
FROM C1 WHERE C1.col1 IN (FROM C2(col1));
FROM C1 WHERE C1.col1 IN (FROM C2(col1));
...
...
manual/docs/DQL (Doctrine Query Language) - Conditional expressions - Literals.php
0 → 100644
View file @
42f7cb70
<b>
Strings
</b><br
\
>
A string literal is enclosed in single quotes—for example: 'literal'. A string literal that includes a single
quote is represented by two single quotes—for example: 'literal''s'.
<div
class=
'sql'
>
<pre>
FROM User WHERE User.name = 'Vincent'
</pre>
</div>
<b>
Integers
</b><br
\
>
Integer literals support the use of PHP integer literal syntax.
<div
class=
'sql'
>
<pre>
FROM User WHERE User.id = 4
</pre>
</div>
<b>
Floats
</b><br
\
>
Float literals support the use of PHP float literal syntax.
<div
class=
'sql'
>
<pre>
FROM Account WHERE Account.amount = 432.123
</pre>
</div>
<br
\
>
<b>
Booleans
</b><br
\
>
The boolean literals are true and false.
<div
class=
'sql'
>
<pre>
FROM User WHERE User.admin = true
FROM Session WHERE Session.is_authed = false
</pre>
</div>
<br
\
>
<b>
Enums
</b><br
\
>
The enumerated values work in the same way as string literals.
<div
class=
'sql'
>
<pre>
FROM User WHERE User.type = 'admin'
</pre>
</div>
<br
\
>
Predefined reserved literals are case insensitive, although its a good standard to write them in uppercase.
manual/docs/DQL (Doctrine Query Language) - Conditional expressions - Subqueries.php
0 → 100644
View file @
42f7cb70
A
subquery
can
contain
any
of
the
keywords
or
clauses
that
an
ordinary
SELECT
query
can
contain
.
<
br
\
><
br
\
>
Some
advantages
of
the
subqueries
:
<
ul
>
<
li
\
>
They
allow
queries
that
are
structured
so
that
it
is
possible
to
isolate
each
part
of
a
statement
.
<
li
\
>
They
provide
alternative
ways
to
perform
operations
that
would
otherwise
require
complex
joins
and
unions
.
<
li
\
>
They
are
,
in
many
people
'
s
opinion
,
readable
.
Indeed
,
it
was
the
innovation
of
subqueries
that
gave
people
the
original
idea
of
calling
the
early
SQL
“
Structured
Query
Language
.
”
</
ul
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment