unique

Show only last duplicates in access query

◇◆丶佛笑我妖孽 提交于 2019-12-24 12:34:55
问题 I have a database in access where I log maps which I loan out. So I have a table called MapsOut, with fields, MapNum(The map ID), MapName (Name of the Map), CheckOut (Date the Maps were loaned out), CheckIn (Date the Maps were returned). MapNum MapName CheckOut CheckIn 1 London 01/02/13 07/05/13 1 London 08/05/13 16/06/13 1 London 19/07/13 2 Hull 30/01/13 05/03/13 2 Hull 06/04/13 01/05/13 3 Derby 11/01/13 17/02/13 3 Derby 05/09/13 06/10/13 4 Hove 01/02/13 01/03/13 I want to write a query that

SQL table - semi-unique row?

为君一笑 提交于 2019-12-24 12:02:53
问题 I have an SQL table with basically the following structure: PK (int, primary key), userID (int), data (varchar 64) Basically, any user as defined by userID is allowed to store any number of short strings. However, no user is allowed to store two identical strings (although user 1 and user 2 can both store the same string separately). I would, if at all possible, like to implement this restriction at the database level because IMHO structural constraints should always be in the tables, as well

How to find single entries in a txt file?

人盡茶涼 提交于 2019-12-24 11:56:07
问题 I have a txt file with 12 columns. Some lines are duplicated and some are not. As an example i copied to first 4 columns of my data. 0 0 chr12 48548073 0 0 chr13 80612840 2 0 chrX 4000600 2 0 chrX 31882528 3 0 chrX 3468481 4 0 chrX 31882726 4 0 chr3 75007624 Based on the first column, you can see that some there are duplicates except entry '3'. I would like to print the only single entries, in this case '3'. The output will be 3 0 chrX 3468481 IS there a quick way of doing this with awk or

Transpose Unique Values from Multiple Columns

拈花ヽ惹草 提交于 2019-12-24 10:49:51
问题 I'm trying to generate unique values in D1:F but my formula is not working. For example, row 1 has A B C milk milk 44 the output should be: D E milk 44 here is my formula and my sheet =ARRAYFORMULA(unique(A1:C)) 回答1: UNIQUE works only in one dimension (row or column) =QUERY(UNIQUE({A:A;B:B;C:C}), "where Col1 is not null", 0) =ARRAYFORMULA(SPLIT(REGEXREPLACE(SUBSTITUTE(TRIM(TRANSPOSE(QUERY(TRANSPOSE({QUERY(QUERY( UNIQUE(SPLIT(TRANSPOSE(SPLIT(TRIM(QUERY(TRANSPOSE(QUERY(TRANSPOSE( IF(LEN(A2:A),

excel count unique combinations of columns

不想你离开。 提交于 2019-12-24 10:29:31
问题 I'm looking to build a formula that counts the number of specific combinations of columns. An example of what I'm looking at for data is similar to this. Invoice Account A1415 1234 A1415 4567 B1415 1234 B1415 1234 B1415 4567 A1415 4567 C1415 1234 Out of this data I have 5 unique combinations from the columns. Can anyone help build a countif equation that looks at both columns together? I'm stumped on this one. Thanks! 回答1: Array formula** , assuming data in A1:B7: =SUM(IF(FREQUENCY(MATCH(A1

Sessions/Session IDs being assigned to more than one user

依然范特西╮ 提交于 2019-12-24 09:37:25
问题 I hope someone out there has some update to date information on sessions and their IDs. I'm running on IIS 7 and we're seeing Sessions assigned to more than 1 IP address. I ruled out the possibility of it being caused by users resetting their IP addresses, for instance by unplugging their modems. In at least one instance a user logged in and found data from a different user in had been saved to his account (the user IDs that determine in which account the data is stored are kept in session

Efficiently determining if large sorted numpy array has only unique values

三世轮回 提交于 2019-12-24 08:46:08
问题 I have a very large numpy array and I want to sort it and test if it is unique. I'm aware of the function numpy.unique but it sorts the array another time to achieve it. The reason I need the array sorted a priori is because the returned keys from the argsort function will be used to reorder another array. I'm looking for a way to do both ( argsort and unique test) without the need to sort the array again. Example code: import numpy as np import numpy.random # generating random arrays with 2

MySQL enforce uniqueness across two columns

百般思念 提交于 2019-12-24 08:03:50
问题 I'm trying to achieve something in MySQL that I have not heard is possible before (maybe it is, researching didn't help me much). What I'm trying to do is enforce uniqueness in MySQL across two columns. What I mean by this is not setting UNIQUE(column1,column2) but the following two conditions: If a value exists in column1, it cannot be repeated in column1 (same as setting UNIQUE(column1)). If a value exists in either column, it cannot exist in the other column. Hence, for the data set

Rails: Generate Unique Random Number for populating a CSS class String How To?

浪尽此生 提交于 2019-12-24 07:38:18
问题 So let's say we have a rails view with this code: <h1>Users who have the <%= @title.name %> Title</h1> <ul> <% @title.users.each do |user| %> <li><%= user.username %> <div class="rw-ui-container rw-urid-X"></div></li> <% end %> </ul> And what we want to do is to automatically print this line: <div class="rw-ui-container rw-urid-X"></div> Right aside each username the loop throws at us BUT we want X to be a different unique random number each time... How can this be accomplished? 回答1: May be

R: Counting the number of matches between multiple data frames

百般思念 提交于 2019-12-24 07:25:21
问题 I want to find the number of matches based on ID of unique matches within multiple data.frames Data looks like this: df1: KeyID x x y y z df2: KeyID x x x z z df3: KeyID x y y z I want to count the number of unique matches between data frames. output would look like this: 2 Since x and z are the only matches between the two sets. I have done this but want to know if there is a faster way: df1.2 <- df2[df2$KeyID %in% df1$KeyID,] length(unique(df1.2$KeyID)) Any thoughts? 回答1: You can do set