Search Results

Search found 13182 results on 528 pages for 'ad group'.

Page 9/528 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • How to find the latest row for each group of data

    - by Jason
    Hi All, I have a tricky problem that I'm trying to find the most effective method to solve. Here's a simplified version of my View structure. Table: Audits AuditID | PublicationID | AuditEndDate | AuditStartDate 1 | 3 | 13/05/2010 | 01/01/2010 2 | 1 | 31/12/2009 | 01/10/2009 3 | 3 | 31/03/2010 | 01/01/2010 4 | 3 | 31/12/2009 | 01/10/2009 5 | 2 | 31/03/2010 | 01/01/2010 6 | 2 | 31/12/2009 | 01/10/2009 7 | 1 | 30/09/2009 | 01/01/2009 There's 3 query's that I need from this. I need to one to get all the data. The next to get only the history data (that is, everything but exclude the latest data item by AuditEndDate) and then the last query is to obtain the latest data item (by AuditEndDate). There's an added layer of complexity that I have a date restriction (This is on a per user/group basis) where certain user groups can only see between certain dates. You'll notice this in the where clause as AuditEndDate<=blah and AuditStartDate=blah Foreach publication, select all the data available. select * from Audits Where auditEndDate<='31/03/10' and AuditStartDate='06/06/2009'; foreach publication, select all the data but Exclude the latest data available (by AuditEndDate) select * from Audits left join (select AuditId as aid, publicationID as pid and max(auditEndDate) as pend from Audit where auditenddate <= '31/03/2009' /* user restrict / group by pid) Ax on Ax.pid=Audit.pubid where pend!=Audits.auditenddate AND auditEndDate<='31/03/10' and AuditStartDate='06/06/2009' / user restrict */ Foreach publication, select only the latest data available (by AuditEndDate) select * from Audits left join (select AuditId as aid, publicationID as pid and max(auditEndDate) as pend from Audit where auditenddate <= '31/03/2009'/* user restrict / group by pid) Ax on Ax.pid=Audit.pubid where pend=Audits.auditenddate AND auditEndDate<='31/03/10' and AuditStartDate='06/06/2009' / user restrict */ So at the moment, query 1 and 3 work fine, but query 2 just returns all the data instead of the restriction. Can anyone help me? Thanks jason

    Read the article

  • "Most popular" GROUP BY in LINQ?

    - by tags2k
    Assuming a table of tags like the stackoverflow question tags: TagID (bigint), QuestionID (bigint), Tag (varchar) What is the most efficient way to get the 25 most used tags using LINQ? In SQL, a simple GROUP BY will do: SELECT Tag, COUNT(Tag) FROM Tags GROUP BY Tag I've written some LINQ that works: var groups = from t in DataContext.Tags group t by t.Tag into g select new { Tag = g.Key, Frequency = g.Count() }; return groups.OrderByDescending(g => g.Frequency).Take(25); Like, really? Isn't this mega-verbose? The sad thing is that I'm doing this to save a massive number of queries, as my Tag objects already contain a Frequency property that would otherwise need to check back with the database for every Tag if I actually used the property. So I then parse these anonymous types back into Tag objects: groups.OrderByDescending(g => g.Frequency).Take(25).ToList().ForEach(t => tags.Add(new Tag() { Tag = t.Tag, Frequency = t.Frequency })); I'm a LINQ newbie, and this doesn't seem right. Please show me how it's really done.

    Read the article

  • Preventing out of office storms Exchange 2010, OWA and Auto Forward to a group

    - by Simon McLaren
    In my organization we have a group mailbox for a particular function. The actual function is preformed by 15 - 20 individuals on a rotating basis. The group mailbox serves as a record for all e-mail sent to that function. Individual access to the mailbox is established by adding a user to an A/D group. For convenience, those members of the group would prefer to not have to "check" this group/non-entiyy mailbox. To achieve that, I want to forward all incoming mail to the group mailbox to that group. So far I am not seeing any consistency in the way an out of office response looks in order to build an exception to the forward rule. We have not turned this feature on for the group, instead waiting until we are sure this will not be an issue. How do I preventing out of office replies to the group mailbox from being forwarded to the group? Management of the mailbox is conducted via OWA. Exchange 2010

    Read the article

  • Transition from GPO to GPP

    - by spelk
    I have a Windows network with a 2003 server as the PDC, and a 2008R2 server as a DC. We have used GPO sparsely when the majority of our workstations were WinXP, but now we have Windows 7 clients and we're having some issues with printer mapping. I'm not quite sure how I would go about taking up GPP, would it involve shifting the PDC over to the 2008R2 server? Any advice on what to do, and how to accomplish it would be very much appreciated.

    Read the article

  • How Facebook's Ad Bid System Works

    - by pnongrata
    When you are creating an ad on Facebook, you are provided with a "suggested bid" range (e.g., $0.90 - $2.15 USD). According to this page: The suggested bid range is there to help you pick a maximum bid so your ad will be successful. It’s based on how many other advertisers are competing to show their ad to the same audience as you are. I'm interested in understanding what's actually going on (technically) under the hood here. Say a user logs into Facebook. On the server-side, it the HTTP request that the user's browser sent (as part of the login) is handled, and the server needs to figure out which ad to display back to the user. I assume this is where the "bidding" system comes into play? Say that, based on this user's demographics, and based on the audience targeting that several competing advertisers designed their campaign with, let's pretend that Facebook sees a pool of 20 different ads it could return. How does this bidding system help Facebook determine which of the 20 ads it returns to the client-side? I'm guessing that advertisers who "bid more" get prioritized over those who "bid less". But when does this bidding take place? How often does an advertiser need to re-bid? How long is a bid binding for? Once I understand these usage-related concepts behind ads, it will probably be obvious between which of the following "selection strategies" the backend is using: Round robin Prioritized round robin Randomized (doubtful) History-based MVP-based Thanks to anyone who can help point me in the right direction and explain what these suggested bid systems are and how they work.

    Read the article

  • Group Video Chat On iPad With Fring App

    - by Gopinath
    Apple’s Facetime is the simplest and most easy to use video chat application available for iOS devices and Apple Macs. Facetime lets you have a one-to-one video chat, but what about having a group chat on your iPad with a bunch of friends? Here comes Fring App for iPad that lets you group chat up to 4 members at a time. Unlike Facetime Fring does not impose any restriction on the network connectivity for video chatting. You can initiate a group video chatting on any network (3G, Wi-Fi, 4G, etc.) but Wi-Fi is the most preferred option for smooth video streaming. Also Fring is a cross platform application(runs on iOS, Android & Nokia), so your group video chat session can have a mix of devices – iPads, Android smartphones/tablets and Nokia mobiles. Anyone mobile device with a front facing  cam and Fring app is allowed to join the party. Here is the promotional ad of Fring’s group video chatting application By the way did I say that Fring is a free app? Group video on iPad at no cost!!! Download Fring from Apple’s AppStore This article titled,Group Video Chat On iPad With Fring App, was originally published at Tech Dreams. Grab our rss feed or fan us on Facebook to get updates from us.

    Read the article

  • MYSQL - Group by limit

    - by jono2010
    Hello Is there a simple way to LIMIT the GROUP BY results to the top 2. The following query returns all the results. Using 'LIMIT 2' reduces the overall list to the top 2 entries only. select distinct(rating_name), id_markets, sum(rating_good) 'good', sum(rating_neutral)'neutral', sum(rating_bad) 'bad' from ratings where rating_year=year(curdate()) and rating_week= week(curdate(),1) group by rating_name,id_markets order by rating_name, sum(rating_good) desc Results in the following :- poland 78 48 24 12 <- keep poland 1 15 5 0 <- keep poland 23 12 6 3 poland 2 5 0 0 poland 3 0 5 0 poland 4 0 0 5 ireland 1 9 3 0 <- keep ireland 2 3 0 0 <- keep ireland 3 0 3 0 ireland 4 0 0 3 france 12 24 12 6 <- keep france 1 3 1 0 <- keep france 231 1 0 0 france 2 1 0 0 france 4 0 0 1 france 3 0 1 0 Thanks Jon

    Read the article

  • Reading Active Directory group users in SharePoint

    - by Faiz
    Hi, Say that i have an active directory group called "Group1". I add this Group1 to a SharePoint site ( People and Group New User). All the users that are part of Group1 can now access sharepoint site. Now,for a specific custom webpart, i need to target to only users who belong to Group1. But when a user who belongs to Group1 logs into the sharepoint site, i am not finding a way to determine from within SharePoint context if this user belongs to Group1. Any thoughts? Thanks, Faiz

    Read the article

  • Two separate fields need to be grouped in one group

    - by Sigita
    I have two fields: Mother's employer and Father's employer, and I need to group on the employer. Could somebody help me combine the two above fields into one group? Both fields are in one table. FOr example a child named John Lewis is a record in a table and he has a father and a mother and Mother's employer is IBM and Father's employer is ISF. And so forth. I need to come up with a list By employer where it would show: Employer: IBM John Lewis Emplyer: ISF John Lewis Employer: .... Thank you, Sigita

    Read the article

  • Odd GROUP BY output DB2 - Results not as expected

    - by CallCthulhu
    If I run the following query: select load_cyc_num , crnt_dnlq_age_cde , sum(cc_min_pymt_amt) as min_pymt , sum(ec_tot_bal) as budget , case when ec_tot_bal 0 then 'Y' else 'N' end as budget , case when ac_stat_cde in ('A0P','A1P','ARP','A3P') then 'Y' else 'N' end as arngmnt , sum(sn_close_bal) as st_bal from statements where (sn_close_bal 0 or ec_tot_bal 0) and load_cyc_num in (200911) group by load_cyc_num , crnt_dnlq_age_cde , case when ec_tot_bal 0 then 'Y' else 'N' end , case when ac_stat_cde in ('A0P','A1P','ARP','A3P') then 'Y' else 'N' end then I get the correct "BUDGET" grouping, but not the correct "ARRANGEMENT" grouping, only two rows have a "Y". If I change the order of the case statements in the GROUP BY, then I get the correct grouping (full Y-N breakdown for both columns). Am I missing something obvious?

    Read the article

  • Mysql query different group by

    - by solomongaby
    Hello i have a products table that contains normal products and configurable product It has a basic stucture of: id name price configurable ('yes', 'no') id_configuration Normal products have configurable no and 0 as id configuration, and configurable products have it set to yes and have the same id_configuration value. The current query is: SELECT `products`.* FROM `products`, `categories`, `product_categories` WHERE `categories`.`id` = 23 AND `products`.`id` = `product_categories`.`id_product` AND `categories`.`id` = `product_categories`.`id_category` AND `products`.`active` = 'yes' AND ORDER BY `pos_new` ASC, `created` DESC LIMIT 0,20 I was wondering if there is a way to group by id_configuration, but only for the configurable products. The reason is that i want only one of the configuration products to show in search. I was thinking i could do a join, but was wondering if there is a way to do some kind of special group by. For example for configurable yes the field should be id_configuration otherwise it should be the id field Thanks a lot for any sugestions

    Read the article

  • SQL: GROUP BY after JOIN without overriding rows?

    - by krismeld
    I have a table of basketball leagues, a table af teams and a table of players like this: LEAGUES ID | NAME | ------------------ 1 | NBA | 2 | ABA | TEAMS: ID | NAME | LEAGUE_ID ------------------------------ 20 | BULLS | 1 21 | KNICKS | 2 PLAYERS: ID | TEAM_ID | FIRST_NAME | LAST_NAME | --------------------------------------------- 1 | 21 | John | Starks | 2 | 21 | Patrick | Ewing | Given a League ID, I would like to retrieve all the players' names and their team ID from all the teams in that league, so I do this: SELECT t.id AS team_id, p.id AS player_id, p.first_name, p.last_name FROM teams AS t JOIN players AS p ON p.team_id = t.id WHERE t.league_id = 1 which returns: [0] => stdClass Object ( [team_id] => 21 [player_id] => 1 [first_name] => John [last_name] => Starks ) [1] => stdClass Object ( [team_id] => 21 [player_id] => 2 [first_name] => Patrick [last_name] => Ewing ) + around 500 more objects... Since I will use this result to populate a dropdown menu for each team containing each team's list of players, I would like to group my result by team ID, so the loop to create these dropdowns will only have to cycle through each team ID instead of all 500+ players each time. But when I use the GROUP BY like this: SELECT t.id AS team_id, p.id AS player_id, p.first_name, p.last_name FROM teams AS t JOIN players AS p ON p.team_id = t.id WHERE t.league_id = 1 GROUP BY t.id it only returns one player from each team like this, overriding all the other players on the same team because of the use of the same column names. [0] => stdClass Object ( [team_id] => 21 [player_id] => 2 [first_name] => Patrick [last_name] => Ewing ) [1] => stdClass Object ( [team_id] => 22 [player_id] => 31 [first_name] => Shawn [last_name] => Kemp ) etc... I would like to return something like this: [0] => stdClass Object ( [team_id] => 2 [player_id1] => 1 [first_name1] => John [last_name1] => Starks [player_id2] => 2 [first_name2] => Patrick [last_name2] => Ewing +10 more players from this team... ) +25 more teams... Is it possible somehow?

    Read the article

  • SQL GROUP BY with "default values"

    - by Christoph Schiessl
    I'm trying to create SELECT statement with a GROUP BY clause, which should return "default values". Imagine the following simple MySQL table: CREATE TABLE `tracker` ( `id` INTEGER PRIMARY KEY auto_increment, `date` DATETIME NOT NULL, `customer_id` INTEGER NOT NULL ); The table contains only one record: INSERT INTO `tracker` (`date`, `customer_id`) VALUES('2010-05-03', 1); After wards I'm executing the following SQL query: SELECT DATE(`date`), COUNT(customer_id) FROM tracker WHERE DATE(`date`) >= '2010-05-01' AND DATE(`date`) <= '2010-05-05' GROUP BY DATE(`date`) ORDER BY DATE(`date`); And get the expected result set: +----+---------------------+-------------+ | id | date | customer_id | +----+---------------------+-------------+ | 1 | 2010-05-10 00:00:00 | 1 | +----+---------------------+-------------+ However, I would like the result set to look like this: +--------------+--------------------+ | DATE(`date`) | COUNT(customer_id) | +--------------+--------------------+ | 2010-05-01 | 0 | | 2010-05-02 | 0 | | 2010-05-03 | 1 | | 2010-05-04 | 0 | | 2010-05-05 | 0 | +--------------+--------------------+ Is it possible to achieve this behavior?

    Read the article

  • Determining Cross Domain Active Directory Group Membership

    - by thecaptain0220
    I am currently working on a project where I need to query Active Directory to determine group membership of a user. I initially was locating the user and retrieving the memberOf attribute. The problem with this is that there is a domain and a child domain. The groups are universal groups so they can be used in both domains and they don't show up in the memberOf attribute. Unfortunately there doesn't seem to be much info around for Active Directory access with C++. Is there anyway to determine group membership in this case in C++?

    Read the article

  • Nhibernate linq group by duplicate fields

    - by jaspion
    Hello, I have a simple query like: from e in endContratoRepository.GetAll() where e.Contrato.idContrato == contrato.idContrato && e.Volume.idVolume == 1 && group e by new { e.dpto.idDepartamento, e.centroCusto.idCentroCusto } into grp select new Entidade { Contagem = grp.Count(), centroCusto = grp.Key.idCentroCusto, dpto = grp.Key.idDepartamento } and the problem: The fields that are in the group by, are duplicated in the generated query. The fields centroCusto and dpto appears twice, so when I try to get the field centroCusto, I get dpto. Anyone know how to solve this? thanks a lot!

    Read the article

  • MySQL GROUP BY with three tables

    - by Psaniko
    I have the following tables: posts (post_id, content, etc) comments (comment_id, post_id, content, etc) posts_categories (post_category_id, post_id, category_id) and this query: SELECT `p`.*, COUNT(comments.comment_id) AS cmts, posts_categories.*,comments.* FROM `posts` AS `p` LEFT JOIN `posts_categories` ON `p`.post_id = `posts_categories`.post_id LEFT JOIN `comments` ON `p`.post_id = `comments`.post_id GROUP BY `p`.`post_id` There are three comments on post_id=1 and four in total. In posts_categories there are two rows, both assigned to post_id=1. I have four rows in posts. But if I query the statement above I get a result of 6 for COUNT(comments.comment_id) at post_id=1. How is this possible? I guess the mistake is somewhere in the GROUP BY clause but I can't figure out where. Any suggestions?

    Read the article

  • SELECT * , COUNT( * ) FROM GROUP BY ORDER BY DESC

    - by quanganh_developer
    I have a table like: gold gold_city | gold_type | gold_selltime ------------------------------------- city1 | type 1 | 2012-01-01 city1 | type 1 | 2012-02-02 city1 | type 1 | 2012-03-03 city2 | type 2 | 2012-01-01 city2 | type 2 | 2012-02-02 city2 | type 2 | 2012-03-03 city3 | type 3 | 2012-01-01 city3 | type 3 | 2012-02-02 city3 | type 3 | 2012-03-03 How can I get 1 last result order by gold_selltime desc each group by gold_city and gold_type I used this: SELECT * , COUNT( * ) FROM gold_2012 GROUP BY gold_type , gold_city ORDER BY gold_selltime DESC but it did work. I only have result like: gold_city | gold_type | gold_selltime ------------------------------------- city1 | type 1 | 2012-01-01 city2 | type 2 | 2012-01-01 city3 | type 3 | 2012-01-01 but I need it like: gold_city | gold_type | gold_selltime ------------------------------------- city1 | type 1 | 2012-03-03 city2 | type 2 | 2012-03-03 city3 | type 3 | 2012-03-03

    Read the article

  • Concatenate and group multiple rows in Oracle

    - by user1693347
    Suppose I have a table like this: NAME GROUP name1 groupA name2 groupB name5 groupC name4 groupA name3 groupC I'd like to have a result like this: GROUP NAMES groupA name1,name4 groupB name2 groupC name3,name5 If there were only one column in the table, I could concatenate the records by doing the following, but with grouping in the context, I really don't have much idea. Any suggestion is welcome, thanks in advance! Concatatenating one column table: SELECT names FROM (SELECT SYS_CONNECT_BY_PATH(names,' ') names, level FROM name_table START WITH names = (SELECT names FROM name_table WHERE rownum = 1) CONNECT BY PRIOR names < names ORDER BY level DESC) WHERE rownum = 1

    Read the article

  • Looking for PHP/MySQL-based ad manager

    - by user359650
    Could you recommend based on your experience a PHP/MySQL-based admin interface for managing your website ads? In order to be really useful, such application should have: -basic CRM functionality to track who is providing the ads -multilingual multi country support: have the ability to specify for the same ad, different versions for multiple languages/countries -predefined ad formats (google Ads, flash ads...) and sizes with corresponding PHP helpers so as to insert in the HTML code the necessary markup to properly integrate the ad. Ideally if that application could be desgined for Zend Framework that would be awesome (but I think I'm dreaming at this point).

    Read the article

  • Grouping by property value and writing group members

    - by Will S
    I need to group the following list by the department value but am having trouble with the LINQ syntax. Here's my list of objects: var people = new List<Person> { new Person { name = "John", department = new List<fields> {new fields { name = "department", value = "IT"}}}, new Person { name = "Sally", department = new List<fields> {new fields { name = "department", value = "IT"}}}, new Person { name = "Bob", department = new List<fields> {new fields { name = "department", value = "Finance"}}}, new Person { name = "Wanda", department = new List<fields> {new fields { name = "department", value = "Finance"}}}, }; I've toyed around with grouping. This is as far as I've got: var query = from p in people from field in p.department where field.name == "department" group p by field.value into departments select new { Department = departments.Key, Name = departments }; So can iterate over the groups, but not sure how to list the Person names - foreach (var department in query) { Console.WriteLine("Department: {0}", department.Department); foreach (var foo in department.Department) { // ?? } } Any ideas on what to do better or how to list the names of the relevant departments?

    Read the article

  • LDAP query on linux against AD returns groups with no members

    - by SethG
    I am using LDAP+kerberos to authenticate against Active Directory on Windows 2003 R2. My krb5.conf and ldap.conf appear to be correct (according to pretty much every sample I found on the 'net). I can login to the host with both password and ssh keys. When I run getent passwd, all my ldap user accounts are listed with all the important attributes. When I run getent group, all the ldap groups and their gid's are listed, but no group members. If I run ldapsearch and filter on any group, the members are all listed with the "member" attribute. So the data is there for the taking, it's just not being parsed properly. It would appear that I simply am using an incorrect mapping in ldap.conf, but I can't see it. I've tried several variations and all give the same result. Here is my current ldap.conf: host <ad-host1-ip> <ad-host2-ip> base dc=my,dc=full,dc=dn uri ldap://<ad-host1> ldap://<ad-host2> ldap_version 3 binddn <mybinddn> bindpw <mybindpw> scope sub bind_policy hard nss_reconnect_tries 3 nss_reconnect_sleeptime 1 nss_reconnect_maxsleeptime 8 nss_reconnect_maxconntries 3 nss_map_objectclass posixAccount User nss_map_objectclass posixGroup Group nss_map_attribute uid sAMAccountName nss_map_attribute gidNumber msSFU30GidNumber nss_map_attribute uidNumber msSFU30UidNumber nss_map_attribute cn cn nss_map_attribute gecos displayName nss_map_attribute homeDirectory msSFU30HomeDirectory nss_map_attribute loginShell msSFU30LoginShell nss_map_attribute uniqueMember member pam_filter objectcategory=User pam_login_attribute sAMAccountName pam_member_attribute member pam_password ad Here's the kicker: this config works 100% fine on a different linux box with a different distro. It does not work on the distro I am planning on switching to. I have installed from source the versions of pam_ldap and nss_ldap on the new box to match the old box, which fixed another problem I was having with this setup. Other relevant info is the original AD box was Windows 2003. It's mirror died a horrible hardware death so I'm trying to add two more 2003-R2 servers to the mirror tree and ultimately drop the old 2003 box. The new R2 boxes appear to have joined the DC forest properly. What do I need to do to get groups working? I've exhausted all the resources I could find and need a different angle. Any input is appreciated. Status update, 7/31/09 I have managed to tweak my config file to get full info from the AD and performance is nice and snappy. I replaced the back-rev'd copies of pam_ldap and nss_ldap with the current ones for the distro I'm using, so it's back to a standard out-of-the-box install. Here's my current config: host <ad-host1-ip> <ad-host2-ip> base dc=my,dc=full,dc=dn uri ldap://<ad-host1> ldap://<ad-host2> ldap_version 3 binddn <mybinddn> bindpw <mybindpw> scope sub bind_policy soft nss_reconnect_tries 3 nss_reconnect_sleeptime 1 nss_reconnect_maxsleeptime 8 nss_reconnect_maxconntries 3 nss_connect_policy oneshot referrals no nss_map_objectclass posixAccount User nss_map_objectclass posixGroup Group nss_map_attribute uid sAMAccountName nss_map_attribute gidNumber msSFU30GidNumber nss_map_attribute uidNumber msSFU30UidNumber nss_map_attribute cn cn nss_map_attribute gecos displayName nss_map_attribute homeDirectory msSFU30HomeDirectory nss_map_attribute loginShell msSFU30LoginShell nss_map_attribute uniqueMember member pam_filter objectcategory=CN=Person,CN=Schema,CN=Configuration,DC=w2k,DC=cis,DC=ksu,DC=edu pam_login_attribute sAMAccountName pam_member_attribute member pam_password ad ssl off tls_checkpeer no sasl_secprops maxssf=0 The remaining problem now is when you run the groups command, not all subscribed groups are listed. Some are (one or two), but not all. Group memberships are still honored, such as file and printer access. getent group foo still shows that the user is a member of group foo. So it appears to be a presentation bug, and does not interfere with normal operation. It also appears that some (I have not determined exactly how many) group searches do not resolve correctly, even though the group is listed. eg, when you run "getent group bar", nothing is returned, but if you run "getent group|grep bar" or "getent group|grep <bar_gid>" you can see that it indeed listed and your group name and gid are correct. This still seems like an LDAP search or mapping error, but I can't figure out what it is. I'm a heckuva lot closer than earlier in the week, but I'd really like to get this last detail ironed out.

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >