Forum Replies Created

Viewing 15 posts - 256 through 270 (of 283 total)

  • RE: Rounding a number up to the nearest 5

    Though not as cool a solution as Mr. Lange's tally table, this alternative is more math oriented than set oriented and is very fast. Plus you could easily turn this...

  • RE: Help with this query (duplicate records)

    CTE's can really make this kind of query so easy!

    Try this out:

    ;with dups as

    (

    Select tesplan_id, tc_external_id, tcversions_id, execution_ts,

    ...

  • RE: Need Help on query

    Luis Cazares (9/2/2013)


    I reviewed the results ans checked the need for a null validation, however it's not needed on all columns and date zero is possible.

    You are right. I was...

  • RE: Need Help on query

    vignesh.ms (9/2/2013)


    is there any other way ?

    This way is fine. It just needs to be modified slightly to handle nulls.

    [Code]

    Select a, b, c,

    case when isNull(a,...

  • RE: Split data from one column into multiple colums

    I see what you are after. The bottom line is that you could do the sub-totaling you are looking for, but it is not elegant or pretty. This is what...

  • RE: Split data from one column into multiple colums

    As you have found out, SQL is not at its best presenting data to the world. That is usually the job of the front end!

    I was not 100% sure what...

  • RE: Split data from one column into multiple colums

    ChrisM@Work (8/20/2013)


    This works and the explanation fits too, but why LEFT JOIN to the link table? dpd shouldn't contain any doctors which aren't in the doctors table, or drugs which...

  • RE: Split data from one column into multiple colums

    I think this is what you are after:

    select d.name, d.packsize, doc.doctorname, doc.location

    from Doctor_Prescribed_Drugs dpd

    left join Doctor doc on dpd.doctorref = doc.doctorref

    left join Drugs ...

  • RE: Get Totals from a Query

    Why did you send them via PM? Now nobody else gets a chance to answer your question. More eyeballs means better odds at getting more and possible better answers.

    JAT

  • RE: searching between two dates - issue of accuracy

    LinksUp

    You said

    The Where clause you have specified will NOT return any row that has a date of 01/03/2000 if the time portion is anything other than 0's. I've...

  • RE: searching between two dates - issue of accuracy

    Lynn Pettis (8/13/2013)I want records for datetimes between 01/01/2000 (after midnight) through 01/03/2000 (through midnight).

    WHERE orderdate BETWEEN '01/01/2000 00:00:00:000 AND '01/03/2000 00:00:00.000'

    After re-reading the requirements, I can see...

  • RE: searching between two dates - issue of accuracy

    Sean Lange (8/13/2013)


    Or you can cast your datetime column as date.

    WHERE cast(orderdate as date) BETWEEN '01/01/2000' AND '01/03/2000'

    Would work well for any query that returned somewhere around less than 10K...

  • RE: select only some rows and then the rest

    Oracle765 (8/11/2013)


    The table is created dynmaically so it will not always be the same columns in the first 3.

    If the table is created dynamically, can't you use a case statement,...

  • RE: select only some rows and then the rest

    Oracle765 (8/11/2013)


    Hi Professionals.

    I am stuck on a way around a query and wonder if it is possible.

    I want to always select the first 3 [columns] rows in the exact order...

  • RE: searching between two dates - issue of accuracy

    polkadot (8/12/2013)


    I want records for datetimes between 01/01/2000 (after midnight) through 01/03/2000 (through midnight). Is the following predicate the correct one to use?

    WHERE orderdate BETWEEN '01/01/2000 00:00:00:000 AND '01/03/2000...

Viewing 15 posts - 256 through 270 (of 283 total)