Search Results

Search found 886 results on 36 pages for 'duplicates'.

Page 18/36 | < Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >

  • MYSQL JOIN SELECT Statment - omit duplicated

    - by mouthpiec
    Hi, I am tying to join the following 2 queries but I am having duplicated .... it is possible to remove duplacted fro this: ( SELECT bar_id, bar_name, town_name, bar_telephone, (subscription_type_id *2) AS subscription_type_id FROM bar, sportactivitybar, towns, subscriptiontype WHERE sport_activity_id_fk =14 AND bar_id = bar_id_fk AND town_id = town_id_fk AND subscription_type_id = subscription_type_id_fk ) UNION ( SELECT bar_id, bar_name, town_name, bar_telephone, subscription_type_id FROM bar, towns, subscriptiontype WHERE town_id = town_id_fk AND subscription_type_id = subscription_type_id_fk ) ORDER BY subscription_type_id DESC , RAND( ) Please note that I need to omit those duplicates that will have a lower subscription_type_id

    Read the article

  • Remove duplicate values

    - by Pankaj
    Hello All I have a class ClientState Class ClientState { Public int ID{get;set;} public string State{get;set;} } List<ClientState> listClientState which contain all states of USA, Now may problem is listClientState contain some objects which have duplicates states. How can i filter listClientState to remove duplicate record

    Read the article

  • MySQL forgot about automatically creating an index for a foreign key?

    - by bobo
    After running the following SQL statements, you will see that, MySQL has automatically created the non-unique index question_tag_tag_id_tag_id on the tag_id column for me after the first ALTER TABLE statement has run. But after the second ALTER TABLE statement has run, I think MySQL should also automatically create another non-unique index question_tag_question_id_question_id on the question_id column for me. But as you can see from the SHOW INDEXES statement output, it's not there. Why does MySQL forget about the second ALTER TABLE statement? By the way, since I have already created a unique index question_id_tag_id_idx used by both question_id and tag_id columns. Is creating a separate index for each of them redundant? mysql> DROP DATABASE mydatabase; Query OK, 1 row affected (0.00 sec) mysql> CREATE DATABASE mydatabase; Query OK, 1 row affected (0.00 sec) mysql> USE mydatabase; Database changed mysql> CREATE TABLE question (id BIGINT AUTO_INCREMENT, html TEXT, PRIMARY KEY(id)) ENGINE = INNODB; Query OK, 0 rows affected (0.05 sec) mysql> CREATE TABLE tag (id BIGINT AUTO_INCREMENT, name VARCHAR(10) NOT NULL, UNIQUE INDEX name_idx (name), PRIMARY KEY(id)) ENGINE = INNODB; Query OK, 0 rows affected (0.05 sec) mysql> CREATE TABLE question_tag (question_id BIGINT, tag_id BIGINT, UNIQUE INDEX question_id_tag_id_idx (question_id, tag_id), PRIMARY KEY(question_id, tag_id)) ENGINE = INNODB; Query OK, 0 rows affected (0.00 sec) mysql> ALTER TABLE question_tag ADD CONSTRAINT question_tag_tag_id_tag_id FOREIGN KEY (tag_id) REFERENCES tag(id); Query OK, 0 rows affected (0.10 sec) Records: 0 Duplicates: 0 Warnings: 0 mysql> ALTER TABLE question_tag ADD CONSTRAINT question_tag_question_id_question_id FOREIGN KEY (question_id) REFERENCES question(id); Query OK, 0 rows affected (0.13 sec) Records: 0 Duplicates: 0 Warnings: 0 mysql> SHOW INDEXES FROM question_tag; +--------------+------------+----------------------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+ | Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | +--------------+------------+----------------------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+ | question_tag | 0 | PRIMARY | 1 | question_id | A | 0 | NULL | NULL | | BTREE | | | question_tag | 0 | PRIMARY | 2 | tag_id | A | 0 | NULL | NULL | | BTREE | | | question_tag | 0 | question_id_tag_id_idx | 1 | question_id | A | 0 | NULL | NULL | | BTREE | | | question_tag | 0 | question_id_tag_id_idx | 2 | tag_id | A | 0 | NULL | NULL | | BTREE | | | question_tag | 1 | question_tag_tag_id_tag_id | 1 | tag_id | A | 0 | NULL | NULL | | BTREE | | +--------------+------------+----------------------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+ 5 rows in set (0.01 sec) mysql>

    Read the article

  • What's the right tool for this job in Google Spreadsheets?

    - by Daniel Harvey
    Is it possible to nest simple programs within a Google doc spreadsheet, similar to how you would w/Basic in Excel? Or alternatively a simple = syntax using regex, if there is a way to do that in google docs? I want to take a list of multiple names(name1, name2, name3) in a single cell from across multiple identical sheets and transpose them to another sheet within the same spreadsheet, check for duplicates and ignore capitals, etc. Is there a way to do this?

    Read the article

  • How can I get a string[] of all different values of a list?

    - by iTayb
    I have a class that has an list<Book> in it, and those Book objects has many many properties. string Subject is one of those properties. I'd like to get an string[] type value that will include all different subjects from all over the list. Is there an elegant way to do it, or I'll have to scan the whole list and enter each subject to it, then remove duplicates?

    Read the article

  • Filtering duplicate array entries with JQuery

    - by systempuntoout
    How do i filter duplicates of two arrays before appending entries to a DOM node (#list)? (function($) { $(document).ready(function() { var item_category1 = $('li.category1').get(); var item_category2 = $('li.category2').get(); $('#list') .append( $(item_category1).clone() ) .append( $(item_category2).clone() ); }); })(jQuery);

    Read the article

  • UUID collision risk using different algorithms

    - by Diego Jancic
    Hi Guys, I have a database where 2 (or maybe 3 or 4) different applications are inserting information. The new information has IDs of the type GUID/UUID, but each application is using a different algorithm to generate the IDs. For example, one is using the NHibernate's "guid.comb", other is using the SQLServer's NEWID(), other might want to use .NET's Guid.NewGuid() implementation. Is there an above normal risk of ID collision or duplicates? Thanks!

    Read the article

  • True or False: Good design calls for every table to have a primary key, if nothing else, a running i

    - by Velika
    Consider a grocery store scenario (I'm making this up) where you have FACT records that represent a sale transaction, where the columns of the Fact table include SaleItemFact Table ------------------ CustomerID ProductID Price DistributorID DateOfSale Etc Etc Etc Even if there are duplicates in the table when you consider ALL the keys, I would contend that a surrogate running numeric key (i.e. identity column) should be made up, e.g., TransactionNumber of type Integer. I can see someone arguing that a Fact table might not have a unique key (though I'd invent one and waste the 4 bytes, but how about a dimension table?

    Read the article

  • All possible combinations of length 8 in a 2d array

    - by CodeJunki
    Hi, I've been trying to solve a problem in combinations. I have a matrix 6X6 i'm trying to find all combinations of length 8 in the matrix. I have to move from neighbor to neighbor form each row,column position and i wrote a recursive program which generates the combination but the problem is it generates a lot of duplicates as well and hence is inefficient. I would like to know how could i eliminate calculating duplicates and save time. int a={{1,2,3,4,5,6}, {8,9,1,2,3,4}, {5,6,7,8,9,1}, {2,3,4,5,6,7}, {8,9,1,2,3,4}, {5,6,7,8,9,1}, } void genSeq(int row,int col,int length,int combi) { if(length==8) { printf("%d\n",combi); return; } combi = (combi * 10) + a[row][col]; if((row-1)>=0) genSeq(row-1,col,length+1,combi); if((col-1)>=0) genSeq(row,col-1,length+1,combi); if((row+1)<6) genSeq(row+1,col,length+1,combi); if((col+1)<6) genSeq(row,col+1,length+1,combi); if((row+1)<6&&(col+1)<6) genSeq(row+1,col+1,length+1,combi); if((row-1)>=0&&(col+1)<6) genSeq(row-1,col+1,length+1,combi); if((row+1)<6&&(row-1)>=0) genSeq(row+1,col-1,length+1,combi); if((row-1)>=0&&(col-1)>=0) genSeq(row-1,col-1,length+1,combi); } I was also thinking of writing a dynamic program basically recursion with memorization. Is it a better choice?? if yes than I'm not clear how to implement it in recursion. Have i really hit a dead end with approach??? Thankyou Edit Eg result 12121212,12121218,12121219,12121211,12121213. the restrictions are that you have to move to your neighbor from any point, you have to start for each position in the matrix i.e each row,col. you can move one step at a time, i.e right, left, up, down and the both diagonal positions. Check the if conditions. i.e if your in (0,0) you can move to either (1,0) or (1,1) or (0,1) i.e three neighbors. if your in (2,2) you can move to eight neighbors. so on...

    Read the article

  • What programming language is good for a beginner and for a hobby? [closed]

    - by Lawrence
    Possible Duplicates: What is the easiest language to start with? What programming language should I choose for an independent study language? Well as the title says what language is good for a beginner and for a hobby? I'll probably be making some games or desktop apps with a gui most likely. I'll be working in Windows and Linux. Oh and could you also give some links to tutorials for the language?

    Read the article

  • What the best approach to iterate and "store" files over a directory in C (Linux) ?

    - by Andrei Ciobanu
    I have written a function that checks if to files are duplicates or not. This function signature is: int check_dup_memmap(char *f1_name, char *f2_name) It returns: (-1) - If something went wrong; (0) - If the two files are similar; (+1) - If the two files are different; The next step is to write a function that iterates through all the files in a certain directory,apply the previous function, and gives a report on every existing duplicates. Initially I've thought to write a function that generates a file with all the filenames in a certain directory and then, read that file again and gain and compare every two files. Here is that version of the function, that gets all the filenames in a certain directory. void *build_dir_tree(char *dirname, FILE *f) { DIR *cdir = NULL; struct dirent *ent = NULL; struct stat buf; if(f == NULL){ fprintf(stderr, "NULL file submitted. [build_dir_tree].\n"); exit(-1); } if(dirname == NULL){ fprintf(stderr, "NULL dirname submitted. [build_dir_tree].\n"); exit(-1); } if((cdir = opendir(dirname)) == NULL){ char emsg[MFILE_LEN]; sprintf(emsg, "Cannot open dir: %s [build_dir_tree]\t",dirname); perror(emsg); } chdir(dirname); while ((ent = readdir(cdir)) != NULL) { lstat(ent->d_name, &buf); if (S_ISDIR(buf.st_mode)) { if (strcmp(".", ent->d_name) == 0 || strcmp("..", ent->d_name) == 0) { continue; } build_dir_tree(ent->d_name, f); } else{ fprintf(f, "/%s/%s\n",util_get_cwd(),ent->d_name); } } chdir(".."); closedir(cdir); } Still I consider this approach a little inefficient, as I have to parse the file again and again. In your opinion what are other approaches should I follow: Write a datastructure and hold the files instead of writing them in the file ? I think for a directory with a lot of files, the memory will become very fragmented. Hold all the filenames in auto-expanding array, so that I can easy access every file by their index, because they will in a contiguous memory location. Map this file in memory using mmap() ? But mmap may fail, as the file gets to big. Any opinions on this. I want to choose the most efficient path, and access as few resources as possible. This is the requirement of the program... EDIT: Is there a way to get the numbers of files in a certain directory, without iterating through it ?

    Read the article

  • JQuery $.unique() issue ie

    - by vanzylv
    Hi Guys var arr = new Array(); arr[0] = 'Departmental News' arr[1] = 'Departmental News' arr[2] = 'Another Cat' arr[3] = 'Another Cat' arr[4] = 'Departmental News' alert(arr) alert($.unique(arr)) In IE I get duplicates. In any other browser only the unique ones Any Ideas?

    Read the article

  • Are duplicate directives in php.ini going to cause an issue?

    - by Brandon G
    I sent a request to ops today to update some php.ini directives, and found out that he merely appended them to the end of the file. My google search didn't really come up with any info on whether this is a problem or not to have duplicates in there and how they would be parsed. Obviously, it can cause confusion, but, I would have a stronger argument if I knew if this was acceptable or not. Any input? Thanks in advance...

    Read the article

  • Delphi component you can't live without?

    - by Warren P
    Most delphi developers have a list of delphi components they wouldn't live without. Not including anything that ships with Delphi (standard VCL or included third-party software like Rave or Indy), what are the components you can't live without, be they commercial or open-source? I will refrain from adding my own answers unless this becomes a community wiki. One component name, or product name, per answer please. Please vote up on components and do not post duplicates.

    Read the article

  • sorting array after array_count_values

    - by umermalik
    hi to all! I have an array of products $products = array_count_values($products); now I have an array where $key is product number and $value is how many times I have such a product in the array. I want to sort this new array that product with the least "duplicates" are on the first place, but what ever I use (rsort, krsort,..) i loose product numbers (key). any suggestions? thanks.

    Read the article

  • Limiting the number of queries returns in SQL Server 2008

    - by Jose Sotero Villegas III
    This is my query SELECT Fullname, rank, id_no, TIN, birthdate, hair, eyes, Blood, height, weight, marks, name, address FROM [******_DOMAIN\****_*****].*******view Problem is, source table has too many duplicates, how do I my limit query to the latest row on the database? I'm using SQL Server 2008. Thanks In advance My next problem is that the view shows me a birthdate string format of yyyymmdd, I need to change it to mm/dd/yyyy can please provide me a function? using the same string above?

    Read the article

  • What is the perfect skill set for a software engineer? [closed]

    - by Sergey
    Of course, except technology stack. I'm asking about more fundamental skills such as design patterns or math. POSSIBLE DUPLICATES: http://stackoverflow.com/questions/76364/what-is-the-single-most-effective-thing-you-did-to-improve-your-programming-skill http://stackoverflow.com/questions/132798/what-should-every-programmer-know http://stackoverflow.com/questions/1177724/what-soft-skills-make-a-great-programmer

    Read the article

  • Collision free hash function for a specific data structure

    - by Max
    Is it possible to create collision free hash function for a data structure with specific properties. The datastructure is int[][][] It contains no duplicates The range of integers that are contained in it is defined. Let's say it's 0..1000, the maximal integer is definitely not greater than 10000. Big problem is that this hash function should also be very fast. Is there a way to create such a hash function? Maybe at run time depending on the integer range?

    Read the article

  • Delphi components you can't live without

    - by Warren P
    Most Delphi developers have a list of Delphi components they wouldn't live without. Not including anything that ships with Delphi (standard VCL or included third-party software like Rave or Indy), what are the components you can't live without, be they commercial or open-source? One component or product name per answer, please. Please do not post duplicates.

    Read the article

< Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >