Search Results

Search found 11834 results on 474 pages for 'radio group'.

Page 11/474 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • 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

  • Using jQuery .find() with multiple conditions at the same time?

    - by fuzzybabybunny
    I know that there are other ways of grabbing radio button values, but I want to know how to do this with .find(). I only want to log the value of the selected radio button, so it requires finding by two conditions at the same time: The button with name=area The button with selected=selected <div class="radio"> <label> <input class="track-order-change" type="radio" name="area" id="area1" value="area1" checked="checked"> Area 1 </label> </div> <div class="radio"> <label> <input class="track-order-change" type="radio" name="area" id="area2" value="area2"> Area 2 </label> </div> <div class="radio"> <label> <input class="track-order-change" type="radio" name="area" id="area3" value="area3"> Area 3 </label> </div> When anything with the class track-order-change changes, it will run the function UpdateOrderSubmission. $('.track-order-change').on('change', function() { updateOrderSubmission() }); I want the updateOrderSubmission function to console log the value of the radio button that is selected. var updateOrderSubmission = function() { var orderSubmission = { area: $('#submit-initial-form').find('[name=area],[checked=checked]').this.val() } console.log(orderSubmission) }; The code above doesn't work. How do I grab the value of the selected radio button? I need to do .find() with two conditions (name and checked), not just one condition.

    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

  • 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

  • Free internet radio station server software with remote broadcasting?

    - by Zachary Brown
    I am in the process of creating an internet radio station, but the two djs I have for it are not able to be in one place. I need for them to be able to login to a web based broadcasting session that still has full functionality. They need to be able to broadcast thier live shows with talk and music. The music will be stroed on the server. I have checked out the Broadwave media streaming server from NCH, but ti does not have the ability to login as a dj from a remote computer. I don't have any money for this, so I need it to be free. If this is not possible, I need it to be cheap!

    Read the article

  • using jquery to disable a series of radio buttons on demand.

    - by holden
    I'm trying to accomplish something similar to Wikipedia's History history page, dynamically disabling radio buttons in a series. Ie... if #4 in group two is selected, then 1-4 of group one are disabled, etc. I know how to disable them individually or as a group, but I'm not sure how to do it in a series of say 1-4: Individually: $("#version_history input[id^=versions_2_3]:radio").attr('disabled',true); or group: $("#version_history input[id^=versions_2]:radio").attr('disabled',true); The inputs are named versions_1_X and versions_2_X, X being some number. 1..2..3.. etc.

    Read the article

  • How do I find the previous/default value of a radio button in JS?

    - by royrules22
    I'm not sure if this is even possible, but I figured I'd ask before clubbing togehter an ugly solution. What I have is a group of radio buttons and I want to trigger a function if the radio button value is changed. For example say there are three buttons X Y and Z with Y default selected. If a user clicks on an unselected button (i.e. X or Z) then the function gets triggered but if he/she clicks on Y (which is already selected) nothing happens. Naturally the best solution would be to fire the function on an onchange event but IE6 doesn't fire onchange until the focus is no longer on the element which is not satisfactory. So is there a way to know what the previous value of the radio button was or at least what its default value is? I could easily create an array of default values and check against that but I'm trying to reduce the overhead. Please no jQuery suggestions ;)

    Read the article

  • How to create Checkboxes that act like Radio buttons with Jquery

    - by hmloo
    I have a post here to show code examples for check/uncheck all checkbox with Jquery. This time I will implement another request that the user should only be able to check at most one of the checkboxes, it's behave like radio buttons. There are 2 cases. Case 1 shows function that has little difference with radio button. It allows the user to deselect checkbox. Case 2 is same as radio button. Case 1 <head id="Head1" runat="server"> <title></title> <script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script> <style type="text/css"> .cbRowItem {display:block;} </style> <script type="text/javascript"> $(document).ready(function() { var $chk = $('input:checkbox .cbRowItem'); $chk.click(function() { $chk.not(this).removeAttr('checked'); }); }); </script> </head> <body> <form id="form1" runat="server"> <div style="display:block;"> <asp:CheckBox id="CheckBox1" runat="server" class="cbRowItem" Text = "CheckBox 1"/> <asp:CheckBox id="CheckBox2" runat="server" class="cbRowItem" Text = "CheckBox 2"/> <asp:CheckBox id="CheckBox3" runat="server" class="cbRowItem" Text = "CheckBox 3"/> <asp:CheckBox id="CheckBox4" runat="server" class="cbRowItem" Text = "CheckBox 4"/> </div> </form> </body> </html> Case 2 <head id="Head1" runat="server"> <title></title> <script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script> <style type="text/css"> .cbRowItem {display:block;} </style> <script type="text/javascript"> $(document).ready(function() { var $chk = $('input:checkbox .cbRowItem'); $chk.click(function() { $chk.removeAttr('checked'); $(this).attr('checked', 'checked'); }); }); </script> </head> <body> <form id="form1" runat="server"> <div style="display:block;"> <asp:CheckBox id="CheckBox1" runat="server" class="cbRowItem" Text = "CheckBox 1"/> <asp:CheckBox id="CheckBox2" runat="server" class="cbRowItem" Text = "CheckBox 2"/> <asp:CheckBox id="CheckBox3" runat="server" class="cbRowItem" Text = "CheckBox 3"/> <asp:CheckBox id="CheckBox4" runat="server" class="cbRowItem" Text = "CheckBox 4"/> </div> </form> </body> </html>

    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

  • PHP - javascript validation radio button

    - by user1806136
    i have a form with 3 sets of radio buttons. i want to set a simple javascript validation alert to appear when user clicks on submit when one of the fields is null. how can i do that using javascript ? my code so far is .. <?php session_start(); $Load=$_SESSION['login_user']; include('../connect.php'); if (isset($_POST['submit'])) { $v1 = intval($_POST['v1']); $v2 = intval($_POST['v2']); $v3 = intval($_POST['v3']); $total = $v1 + $v2 + $v3 ; mysql_query("INSERT into Form1 (P1,P2,P3,TOTAL) values('$v1','$v2','$v3','$total')") or die(mysql_error()); header("Location: mark.php"); } <center><form method="post" action="mark.php" > <tr> <th > School Evaluation <font size="4" > </font></th> <tr> <th > Criteria <font size="4" > </font></th> <th> 4<font size="4" > </font></th> <th> 3<font size="4" > </font></th> <th> 2<font size="4" > </font></th> <th> 1<font size="4" > </font></th> </tr> <tr> <th> Your attendance<font size="4" > </font></th> <td> <input type="radio" name ="v1" value = "4" onclick="updateTotal();"/></td> <td> <input type="radio" name ="v1" value = "3" onclick="updateTotal();" /></td> <td> <input type="radio" name ="v1" value = "2" onclick="updateTotal();" /></td> <td> <input type="radio" name ="v1" value = "1" onclick="updateTotal();" /></td> </tr> <tr> <th > Your grades <font size="4" > </font></th> <td> <input type="radio" name ="v2" value = "4" onclick="updateTotal();" /></td> <td> <input type="radio" name ="v2" value = "3" onclick="updateTotal();" /></td> <td> <input type="radio" name ="v2" value = "2" onclick="updateTotal();" /></td> <td> <input type="radio" name ="v2" value = "1" onclick="updateTotal();" /></td> </tr> <tr> <th >Your self-control <font size="4" > </font></th> <td> <input type="radio" name ="v3" value = "4" onclick="updateTotal();" /></td> <td> <input type="radio" name ="v3" value = "3" onclick="updateTotal();" /></td> <td> <input type="radio" name ="v3" value = "2" onclick="updateTotal();" /></td> <td> <input type="radio" name ="v3" value = "1" onclick="updateTotal();" /></td> </tr> </tr> </table> i have put <br> <td><input type="submit" name="submit" value="Submit" onClick="return validation(form);"> <input type="reset" name="clear" value="clear" style="width: 70px"></td> </form> i have try alot of codes but no alert appears!

    Read the article

  • Returning Value of Radio Button Jquery [migrated]

    - by Jerry Walker
    I am trying to figure out why, when I run this code, I am getting undefined for my correct answers. $(document).ready (function () { // var answers = [["Fee","Fi","Fo"], ["La","Dee","Da"]], questions = ["Fee-ing?", "La-ing?"], corAns = ["Fee", "La"]; var counter = 0; var $facts = $('#main_ .facts_div'), $question = $facts.find('.question'), $ul = $facts.find('ul'), $btn = $('.myBtn'); $btn.on('click', function() { if (counter < questions.length) { $question.text(questions[counter]); var ansstring = $.map(answers[counter], function(value) { return '<li><input type="radio" name="ans" value="0"/>' + value + '</li>'}).join(''); $ul.html(ansstring); var currentAnswers = $('input[name="ans"]:checked').map(function() { return this.val(); }).get(); var correct = 0; if (currentAnswers[counter]==corAns[counter]) { correct++; } } else { $facts.text('You are done with the quiz ' + correct); $(this).hide(); } counter++; }); // }); It is quite long and I'm sorry about that, but I don't really know how tostrip it down. I also realize this isn't the most elegant way to do this, but I just want to know why I can't seem to get my radio values. I will add the markup as well if anyone wants.

    Read the article

  • translate stored procedure - to Linq2SQL (count, max, group, orderby)

    - by Walter
    I've two tables (1:N) CREATE TABLE master (idMaster int identity (1,1) not null, TheName varchar( 100) null, constraint pk_master primary key(idMaster) clustered) and - CREATE TABLE lnk (idSlave int not null, idMaster int not null, constraint pk_lnk_master_slave(idSlave) primary key clustered) link between Master.idMaster and lnk.idMaster I've a SQL query: select max (master.idMaster) as idMaster, master.theName, count (lnk.idSlave) as freq from lnk inner join master ON lnk.idMaster = master.idMaster Group by master.theName order by freq desc, master.theName I need to translate this T-SQL query to a Linq-to-SQL statement, preferably in C#

    Read the article

  • Better way to do SELECT with GROUP BY

    - by Luca Romagnoli
    Hi i've wrote a query that works: SELECT `comments`.* FROM `comments` RIGHT JOIN (SELECT MAX( id ) AS id, core_id, topic_id FROM comments GROUP BY core_id, topic_id order by id desc) comm ON comm.id = comments.id LIMIT 10 I want know if it is possible (and how) to rewrite it to get better performance. Thanks

    Read the article

  • cakePHP and GROUP BY

    - by Lizard
    I am trying to solve a hopefully simple problem here is the query I am trying produce: SELECT `categories`.*, COUNT(`entities`.id) FROM `categories` LEFT JOIN `entities` ON (`categories`.`id` = `entities`.`category_id`) GROUP BY `categories`.`id` I am really struggling to do this is in cakePHP 1.2 How would/should I go about doing this... (I am using 'Containable' if that helps) Thanks in advance

    Read the article

  • How to create entities in one Entity group ?

    - by Gopi
    I am building an app based on google app engine (Java) using JDO for persistence. Can someone give me an example or a point me to some code which shows persisting of multiple entities (of same type) using javax.jdo.PersistenceManager.makePersistentAll() within a transaction. Basically I need to understand how to put multiple entites in one Entity Group so that they can be saved using makePersistentAll() inside transaction.

    Read the article

  • GROUP BY a date, with ordering by date.

    - by standard
    Take this simple query: SELECT DATE_FORMAT(someDate, '%y-%m-%d') as formattedDay FROM someTable GROUP BY formatterDay This will select rows from a table with only 1 row per date. How do I ensure that the row selected per date is the earliest for that date, without doing an ordered subquery in the FROM? Cheers

    Read the article

  • MYSQL Select statment Order By with Group By

    - by mouthpiec
    I have the following simple SQL statment SELECT id, name, value_name, value_id FROM table GROUP BY id ORDER BY value_id DESC when grouping I would like to get the value_name and value_id of the tuple where the value_id is the biggest. The way it is i am getting the smallest value. For example 1, name1, valuename, 3 (where i know that there is a value_id of 5) Can you please help?

    Read the article

  • Better mode for do a select with group by

    - by Luca Romagnoli
    Hi i've wrote a query that works: SELECT `comments`.* FROM `comments` RIGHT JOIN (SELECT MAX( id ) AS id, core_id, topic_id FROM comments GROUP BY core_id, topic_id order by id desc) comm ON comm.id = comments.id LIMIT 10 I want know if is possible and how rewrite it for get better performance. thanks

    Read the article

  • sql - getting the id from a row based on a group by

    - by user85116
    Table A tableAID tableBID grade Table B tableBID name description Table A links to Table b from the tableBID found in both tables. If I want to find the row in Table A, which has the highest grade, for each row in Table B, I would write my query like this: select max(grade) from TableA group by tableBID However, I don't just want the grade, I want the grade plus id of that row.

    Read the article

  • MySQL: group by and IF statement

    - by notset
    By default, parent_id = 0. I want to select all records with parent_id = 0 and only the last ones with parent_id 0. I tried this, but it didn't work: SELECT * FROM `articles` IF `parent_id` > 0 THEN GROUP BY `parent_id` HAVING COUNT(`parent_id`) >= 1 END; ORDER BY `time` DESC What could be the solution?

    Read the article

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