Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

« Newer Snippets
Older Snippets »
Showing 1-5 of 5 total  RSS 

sql count

// description of your code here

select count (*) as total from bppersondisabledstandardsetups group by setuptype;
select distinct bppersondisabledstandardsetups.setuptype from bppersondisabledstandardsetups;
select max(objid) from sdfields;

Sql max search

Question: I'm trying to retrieve some info from an Oracle database. I've got a table named Scoring with two fields - Name and Score. What I want to get is the highest score from the table and the name of the player.

    SELECT Name, Score
    FROM Scoring
    WHERE Score = (select Max(Score) from Scoring);

<http://www.techonthenet.com/sql/max.php>

LIMIT - Make sure val falls between lower and upper bounds, inclusive; uses length for series values.

    limit: func [
        "Make sure val falls between lower and upper bounds, inclusive; uses length for series values."
        val
        lower [integer!]
        upper [integer!]
        /show "For series values, show extension/truncation (dot/none for extension, 3 dots for truncation)."
        /local fill
    ][
        either not series? val [max min val upper lower] [
            either all [
                upper >= length? val
                lower <= length? val
            ] [val] [
                ; If extending the series, use NONE as the fill value, so the
                ; block can still be processed easily.
                fill: either any-string? val ["."] [none]
                head either lower >= length? val [
                    insert/only/dup tail val fill subtract lower length? val
                ][
                    clear skip val upper
                    either show [change/dup skip tail val -3 '. 3] [val]
                ]
            ]
        ]
    ]

limit function - limit a value within bounds

limit: func [
    "Make sure val falls between lower and upper bounds, inclusive"
    val lower upper
][
    max min val upper lower
]

max-of function

    ; This returns only the maximum value out of context maximum-of returns the series
    ; at the position of the maximum value found.
    max-of: func [series [series!]] [attempt [first maximum-of series]]

« Newer Snippets
Older Snippets »
Showing 1-5 of 5 total  RSS