Difference between revisions of "Issue queries"
(Created page with "<p>Here you are shown how to issue queries without using a table.</p> <p>This is done in different ways across different platforms but all of them will give a single row of in...") |
|||
| Line 1: | Line 1: | ||
<p>Here you are shown how to issue queries without using a table.</p> | <p>Here you are shown how to issue queries without using a table.</p> | ||
<p>This is done in different ways across different platforms but all of them will give a single row of information.</p> | <p>This is done in different ways across different platforms but all of them will give a single row of information.</p> | ||
| − | |||
<div class='ht'> | <div class='ht'> | ||
<div class=params>schema:scott</div> | <div class=params>schema:scott</div> | ||
Latest revision as of 09:56, 8 August 2012
Here you are shown how to issue queries without using a table.
This is done in different ways across different platforms but all of them will give a single row of information.
Only certain functions can be used without a table and these functions are called static functions.
Static functions can allow a user to obtain the current username, current date, current timestamp and also the version of the database being used.
SELECT CURRENT_USER, CURRENT_DATE
SELECT USER, CURRENT_DATE FROM dual
SELECT SYSTEM_USER, GETDATE()
SELECT ENVIRON('username'), DATE()
Hack 10 Converting subqueries into joins
Hack 11 Converting aggregate subqueries into joins
Hack 16 Search for a String across columns
Hack 24 Multiply Across a Result Set
Hack 25.5 Splitting and combining columns
Hack 26 Include the rows your JOIN forgot
Hack 30 Calculate the maximum/minimum of two fields
Hack 33 Get values and subtotals in one shot
Hack 50 Combine tables containing different data
Hack 51/52 Display rows as columns
Hack 55 Import Someone Else's Data
Hack 62 Issue Queries Without Using a Table
Hack 63 Generate rows without tables
Hack 72 Extract a subset of the results
Hack 78 Break it down by Range
Hack 88 Test two values from a subquery