Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
S

Spacix One

@Spacix One
About
Posts
258
Topics
13
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Help with optimization for searching a data table for a logical 'AND'
    S Spacix One

    I added an index to the record_id indicator with an alter table and now my original query returns in 0.58 seconds (db time) instead of ~400 seconds (db time) Guess this just goes shows me even more how crappy the self proclaimed coder/dba that designed this was, not that I didn't already know he was full of himself by looking at his code ;)


    -Spacix All your skynet questions[^] belong to solved

    Database algorithms css performance help tutorial

  • Help with optimization for searching a data table for a logical 'AND'
    S Spacix One

    David Skelly wrote:

    The solution that you posted would give you a list of record_ids that have entries in the table for both (type = 1002 and value > 20) AND (type = 1003 and value > 40).

    Is exactly what I'm trying todo, but need a faster method. I don't really have control over the table, but I can force an index on that column since I can run SQL against the whole table. Maybe it'll speed up if I toss an alter table to add an index to the result_id... Yes, yes that just might work! David Skelly you're an evil genius.


    -Spacix All your skynet questions[^] belong to solved

    Database algorithms css performance help tutorial

  • Help with optimization for searching a data table for a logical 'AND'
    S Spacix One

    Thank you for the reply i.j.russell This is acually what I have currently, but this is a logical OR where I'm needing to do a logical AND. I want to a one or more record_id values that contains a "parm_type=1002 AND value > 20" and a "parm_type=1004 AND value > 40." This makes it a bit harder to search :(


    -Spacix All your skynet questions[^] belong to solved

    Database algorithms css performance help tutorial

  • Help with optimization for searching a data table for a logical 'AND'
    S Spacix One

    Navaneeth thank you for your reply. I think a UNION statment would merge record_id that would match either of the parm_type requirements. Please correct me if I am wrong!


    -Spacix All your skynet questions[^] belong to solved

    Database algorithms css performance help tutorial

  • Help with optimization for searching a data table for a logical 'AND'
    S Spacix One

    Maybe I need more clairification (and a better example) Ok so I want to find everything with the same record ID, that has atleast one match for every parm_type and value spesified. What has be suggested so far is a "logical" OR and meaning any of the parm_type and value criteria match. A better example would be one that actually returns data, I apologize for my previous bad example.

    SELECT id,record_id,parm_type,value FROM data_table
    WHERE record_id IN
    (
    SELECT record_id FROM data_table
    WHERE parm_type=1002 AND value > 20
    )
    AND record_id IN
    (
    SELECT record_id FROM data_table
    WHERE parm_type=1003 AND value >= 40
    );

    If I were to run this with the data_table in my previous post I'd expect to be returned would be the following result table:

    Result from: data_table

    id

    record_id

    parm_type

    value

    8

    2

    1005

    20

    9

    2

    1002

    30

    10

    2

    1003

    40

    11

    2

    1008

    50

    12

    3

    1007

    20

    13

    3

    1002

    30

    14

    3

    1003

    40

    15

    3

    1007

    50

    I hope this could clear things up.


    -Spacix All your skynet questions[^] belong to solved

    Database algorithms css performance help tutorial

  • Help with optimization for searching a data table for a logical 'AND'
    S Spacix One

    I'm trying to search some data in a table I don't have control over and I need to figure out how to do an logical and between two specified search items. I need to find all rows in a table that has the same value in collumn A and column B is equal to X or Y. The is similar to the following, but it contains more than 600,000 records.

    Tablename: data_table

    id

    record_id

    parm_type

    value

    0

    0

    1001

    10

    1

    0

    1002

    20

    2

    0

    1003

    30

    3

    0

    1004

    40

    4

    1

    1001

    15

    5

    1

    1002

    25

    6

    1

    1003

    35

    7

    1

    1004

    45

    8

    2

    1005

    20

    9

    2

    1002

    30

    10

    2

    1003

    40

    11

    2

    1008

    50

    12

    3

    1007

    20

    13

    3

    1002

    30

    14

    3

    1003

    40

    15

    3

    1007

    50

    16

    4

    1001

    20

    17

    4

    1002

    30

    18

    4

    1007

    40

    19

    4

    1008

    50

    I want to get every value with the same record_id, that has a parm_type type of 1002 or 1003 and the value is greater than 20 for type 1002 and less than 40 for 1003. Here is what I tried but it was taking very long and gets execution timeouts

    SELECT id,record_id,parm_type,value FROM data_table
    WHERE record_id IN
    (
    SELECT record_id FROM data_table
    WHERE parm_type=1002 AND value > 20
    )
    AND record_id IN
    (
    SELECT record_id FROM data_table
    WHERE parm_type=1003 AND value > 40
    );

    I know there have to be others ways to accomplish this, but I'm no DBA...


    -Spacix All your

    Database algorithms css performance help tutorial

  • Send SMS /MMS to mobile phone from FTP server
    S Spacix One

    Most carriers allow email to SMS with the phone number.

    some examples I know off hand

    company name

    email

    T-Mobile:

    phonenumber@tmomail.net

    Sprint:

    phonenumber@messaging.sprintpcs.com

    Verizon:

    phonenumber@vtext.com


    -Spacix All your skynet questions[^] belong to solved

    C# csharp com sysadmin help

  • void and static void problem
    S Spacix One

    unless you pass an instance reference to it...


    -Spacix All your skynet questions[^] belong to solved


    I dislike the black-and-white voting system on questions/answers. X|


    C# help tutorial

  • User Control Tutorial
    S Spacix One

    http://msdn.microsoft.com/en-us/library/a6h7e207(VS.80).aspx[^] Would be the best place to start...


    -Spacix All your skynet questions[^] belong to solved

    C# tutorial design help

  • Interfacing with hardware through RS232
    S Spacix One

    I'm not sure what else to say, as RS232 is just a physical communication protocol, which is layer one of the OSI model. The format of the data sent and received is per device, as well as it would be you who needs to implement layer two though seven. To help with layer two through four use a state machine in your back end wrapped around the .NET serial port class. It is good to be safe because serial communication can be prone to transmission errors that can soft lock your application.


    -Spacix All your skynet questions[^] belong to solved

    C# csharp question hardware help

  • MSXML package
    S Spacix One

    They are 100% separate things, MSXML is legacy XML interface from a while back build into IE5.5 and still used for XML DOM in JScript along with MSHTML. Most people have used Msxml2 if you've messed with AJAX in IE. System.XML and MSXML are incompatabale data types. I don't know of, nor heard of a way to Marshal from one to the other.


    -Spacix All your skynet questions[^] belong to solved


    I dislike the black-and-white voting system on questions/answers. X|


    C# csharp xml question dotnet

  • File copying, byte by byte, w/progress bar
    S Spacix One

    I'm not sure I'd would do this the same way, totalBytesRead would have to be class variable and volatile to display it on the UI. Else the worker has a copy of the original data and can't change it. Why not use a delegate you could invoke to update the UI from the worker?


    -Spacix All your skynet questions[^] belong to solved


    I dislike the black-and-white voting system on questions/answers. X|


    C# help csharp design performance announcement

  • Can anyboy help me design my own interface for scanning application using Twain?
    S Spacix One

    google "twain.net"[^]


    -Spacix All your skynet questions[^] belong to solved


    I dislike the black-and-white voting system on questions/answers. X|


    C# help csharp design question

  • How to open a windows form window from an outlook mail
    S Spacix One

    One day we shall get a combined post: I too would like to see this code, can the author make it so that it looks like paypal and ask for credit card info then sends me this info with their entire address book?? I need it by Monday for my final project, plz send meh teh codez!


    -Spacix All your skynet questions[^] belong to solved


    I dislike the black-and-white voting system on questions/answers. X|


    C# question help tutorial

  • Does this qualify as horror?
    S Spacix One

    Megidolaon wrote:

    string XMLCommand = "<<Command Name=\"DoStuff\" ID=\"";
    XMLCommand += ID.ToString();
    XMLCommand += "\"/>";

    My eyes! The goggles do nothing!


    -Spacix All your skynet questions[^] belong to solved


    I dislike the black-and-white voting system on questions/answers. X|


    The Weird and The Wonderful html xml question

  • Another loop bites the dust
    S Spacix One

    you mean they didn't want 4294967294 copies??? (till it reached zero again)


    -Spacix All your skynet questions[^] belong to solved


    I dislike the black-and-white voting system on questions/answers. X|


    The Weird and The Wonderful testing beta-testing career

  • Attributes and there constructors...
    S Spacix One

    no problem, it is hard to look up something if you don't know its proper name or origin base class :) MSDN has information here: http://msdn.microsoft.com/en-us/library/system.attribute.aspx[^] Look for "abbreviated name"


    -Spacix All your skynet questions[^] belong to solved


    I dislike the black-and-white voting system on questions/answers. X|


    C# question

  • Attributes and there constructors...
    S Spacix One

    stuff surrounded by "[" and "]" are not normal classes. They are class attributes and can be used hundreds of different ways... Look here for more info: http://www.codeproject.com/KB/cs/attributes.aspx[^]


    -Spacix All your skynet questions[^] belong to solved


    I dislike the black-and-white voting system on questions/answers. X|


    C# question

  • How to read wav file from a xml file in C#
    S Spacix One

    http://www.codeproject.com/KB/cs/base64encdec.aspx[^] http://www.csharp411.com/convert-binary-to-base64-string/[^]


    -Spacix All your skynet questions[^] belong to solved


    I dislike the black-and-white voting system on questions/answers. X|


    C# csharp xml tutorial

  • WebBrowser.Print
    S Spacix One

    this.WebBrowser1.Document.InvokeScript("window.print");


    -Spacix All your skynet questions[^] belong to solved


    I dislike the black-and-white voting system on questions/answers. X|


    C# csharp html
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups