Search Results

Search found 17924 results on 717 pages for 'order by'.

Page 23/717 | < Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >

  • group by, order by, with join

    - by Scarface
    Hey guys, quick question, I have this query, and I am trying to get the latest comment for each topic and then sort those results in descending order (therefore one comment per topic). I have what I think should work, but my join always messes my results up. Somehow, it seems to have sorted the end results properly, but has not taken the latest comment from each topic instead it seems to have just taken a random comment. If anyone has any ideas, would really appreciate any advice SELECT * FROM comments JOIN topic ON topic.topic_id=comments.topic_id WHERE topic.creator='admin' GROUP BY comments.topic_id ORDER BY comments.time DESC table comments is structured like id time user message topic_id table topic is structured like topic_id subject_id topic_title creator timestamp description

    Read the article

  • FreeText Query is slow - includes TOP and Order By

    - by Eric P
    The Product table has 700K records in it. The query: SELECT TOP 1 ID, Name FROM Product WHERE contains(Name, '"White Dress"') ORDER BY DateMadeNew desc takes about 1 minute to run. There is an non-clustered index on DateMadeNew and FreeText index on Name. If I remove TOP 1 or Order By - it takes less then 1 second to run. Here is the link to execution plan. http://screencast.com/t/ZDczMzg5N Looks like FullTextMatch has over 400K executions. Why is this happening? How can it be made faster?

    Read the article

  • Stored Procedure - forcing execution order

    - by meepmeep
    I have a stored procedure that itself calls a list of other stored procedures in order: CREATE PROCEDURE [dbo].[prSuperProc] AS BEGIN EXEC [dbo].[prProc1] EXEC [dbo].[prProc2] EXEC [dbo].[prProc3] --etc END However, I sometimes have some strange results in my tables, generated by prProc2, which is dependent on the results generated by prProc1. If I manually execute prProc1, prProc2, prProc3 in order then everything is fine. It appears that when I run the top-level procedure, that Proc2 is being executed before Proc1 has completed and committed its results to the db. It doesn't always go wrong, but it seems to go wrong when Proc1 has a long execution time (in this case ~10s). How do I alter prSuperProc such that each procedure only executes once the preceding procedure has completed and committed? Transactions?

    Read the article

  • Erlang Question - Time order of messages

    - by Aiden Bell
    Read (skimmed enough to get coding) through Erlang Programming and Programming Erlang. One question, which is as simple as it sounds: If you have a process Pid1 on machine m1 and a billion million messages are sent to Pid1, are messages handled in parallel by that process (I get the impression no) and(answered below) is there any guarantee of order when processing messages? ie. Received in order sent? If so, how is clock skew handled in high traffic situations for ordering? Coming from the whole C/Thread pools/Shared State background ... I want to get this concrete. I understand distributing an application, but want to ensure the 'raw bones' are what I expect before building processes and distributing workload. Also, am I right in thinking the whole world is currently flicking through Erlang texts ;)

    Read the article

  • Twitter Streaming API - tracking exact multiple keywords in exact order

    - by Gublooo
    Hey Guys, I'm just beginning to play with the Twitter Streaming API. If I specify $sc-setTrack(array('just bought from')); This will correctly pull only tweets that have all 3 keywords - but doesn't maintain the order. 1) I want the keywords to appear in the same order like "I just bought apple from itunes" but the above also returns tweets like "I bought some apples and just removed them from the bag" 2) Is there a way to specify the exact words say "NBA basketball" with nothing in between - in the sense I dont want tweets like this to be returned Watching basketball on NBA tv I just want tweets which contain the exact phrase to be returned like I love watching NBA basketball 3) Also is there a way to specify negative keywords Any tips if this is possible. Thanks

    Read the article

  • MySQL LEFT JOIN, GROUP BY and ORDER BY not working as required

    - by Simon
    I have a table 'products' => ('product_id', 'name', 'description') and a table 'product_price' => ('product_price_id', 'product_id', 'price', 'date_updated') I want to perform a query something like SELECT `p`.*, `pp`.`price` FROM `products` `p` LEFT JOIN `product_price` `pp` ON `pp`.`product_id` = `p`.`product_id` GROUP BY `p`.`product_id` ORDER BY `pp`.`date_updated` DESC As you can probably guess the price changes often and I need to pull out the latest one. The trouble is I cannot work out how to order the LEFT JOINed table. I tried using some of the GROUP BY functions like MAX() but that would only pull out the column not the row. Thanks.

    Read the article

  • How to repair "order by" after union of 2 selects from 1 tables

    - by 4e4el
    I have a dropDownList on my form, where i need to have union of values from 2 colums of table [ost]. Type of this columns is currency. I have russian version of access, default value of curency in "rur" and i need "uah". I need to change format and save "order by". I use this query: (SELECT distinct FORMAT([Sum1] ,'# ##0.00" uah.";-# ##0.00" uah."') FROM ost) Union (SELECT distinct FORMAT([Sum2],'# ##0.00" uah.";-# ##0.00" uah."') FROM ost) ORDER BY 1

    Read the article

  • Getting req.params in order in Express JS

    - by Adam Terlson
    In Express, is there a way to get the arguments passed from the matching route in the order they are defined in the route? I want to be able to apply all the params from the route to another function. The catch is that those parameters are not known up front, so I cannot refer to each parameter by name explicitly. app.get(':first/:second/:third', function (req) { output.apply(this, req.mysteryOrderedArrayOfParams); // Does this exist? }); function output() { for(var i = 0; i < arguments.length; i++) { console.log(arguments[i]); } } Call on GET: "/foo/bar/baz" Desired Output (in this order): foo bar baz

    Read the article

  • Need help with a sub query/group/order (get latest comment for each ordered topic)

    - by Scarface
    Hey guys I have a query that currently finds the latest comment for each of a user's topics and then orders topics by that comment's timestamp. What I want to do is expand on this query's use and print the latest comment for each topic. The problem with this query is that while it orders the topics correctly, it prints seemingly random comments for each topic. I am trying to implement a sub query but I am not quite sure how to approach it. I was thinking that I just had to somehow use this query to get the comments. If anyone has any ideas I would really appreciate it. Here is what I think I need to add SELECT * FROM comments where topic_id='$topic_id' ORDER BY timestamp DESC LIMIT 1 Here is the query I need to modify SELECT topic.topic_title, topic.content_type, topic.subject_id, topic.creator, topic.description, topic.topic_id,comments.message,comments.user FROM comments JOIN topic ON topic.topic_id = comments.topic_id WHERE topic.creator = '$user' AND comments.timestamp > $week GROUP BY topic_id ORDER BY MAX(comments.timestamp) DESC

    Read the article

  • Mulitple words in any order using regex

    - by RC1140
    As the title says , i need to find 2 specific words in a sentence. But they can be in any order and any casing. How do i go about doing this using regex. E.g. This is a very long sentence used as a test From that sentence i need to extract the words test and long in any order i.e. test can be first or long can be first. UPDATE: What i did not mention the first part is it needs to be case insensitive as well

    Read the article

  • Select photo while keep the order

    - by wong2
    I have a list of photo on the page, each have an unique id, user can click on them to toggle select the photo, when they click the submit button, I need to send the array of selected photo ids to the back end, in the order that the photo was selected. I think that the fastest way to track if a photo is selected is to use an object that use photo id as key, like: var selected = { "6272861": true, "6272888": true } when the user unselect a photo, I just need to delete selected["6272861"]. But this will ignore the order, if I use an array to keep the selected photos: var selected = ["6272861", "6272888"]; then when I need to unselect a photo, I have to loop through the array and delete the item. Is there better ways? thanks.

    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

  • Complex data ordering...

    - by Povylas
    Hi, I have one tables ids in an array and they are ordered in the way I want and I have to select data from another table using those ids and in a order they are listen in the array. Pretty confusing but I was thinking of two solutions giving ORDER BY parameter the array but I do not know if that possible and another is to get all the necessary data and then turn it to array (mysql_fetch_assoc) then compare those two and somehow order the new array using the ids array. But I also do not know how to do this... Any ideas?

    Read the article

  • Weird order when painting triangle outlines using GL_LINE_STRIP

    - by RayDeeA
    I'm developing an app for iOS-Plaftorms using OpenGL. Currently I'm having a weird issue when painting a plane (terrain) which consists of multiple subplanes, where each subplane consists of 2 triangles forming a rect. I'm painting this terrain as a wireframe by using a call to glDrawElements and provide the parameters GL_Line_Strip and the precalculated indices. The problem is that the triangles get painted in the wrong order or are rather vertically mirrored. They do not get painted in the order how I specified the indices, which is confusing. This is the simplified code to generate the vertices: for(NSInteger y = - gridSegmentsY / 2; y < gridSegmentsY / 2; y ++) { for(NSInteger x = - gridSegmentsX / 2; x < gridSegmentsX / 2; x ++) { vertices[pos++] = x * 5; vertices[pos++] = y * 5; vertices[pos++] = 0; } } This is how I generate the indices including degenerated ones (To use as IBO). pos = 0; for(int y = 0; y < gridSegmentsY - 1; y ++) { if (y > 0) { // Degenerate begin: repeat first vertex indices[pos++] = (unsigned short)(y * gridSegmentsY); } for(int x = 0; x < gridSegmentsX; x++) { // One part of the strip indices[pos++] = (unsigned short)((y * gridSegmentsY) + x); indices[pos++] = (unsigned short)(((y + 1) * gridSegmentsY) + x); } if (y < gridSegmentsY - 2) { // Degenerate end: repeat last vertex indices[pos++] = (unsigned short)(((y + 1) * gridSegmentsY) + (gridSegmentsX - 1)); } } So in this part... indices[pos++] = (unsigned short)((y * gridSegmentsY) + x); indices[pos++] = (unsigned short)(((y + 1) * gridSegmentsY) + x); ...I'm setting the first index in the indices array to point to the current (x,y) and the next index to (x,y+1). I'm doin' this for all x's in the current strip, then I'm handling degenerated triangles and repeat this procedure for the next strip (y+1). This method is taken from http://www.learnopengles.com/android-lesson-eight-an-introduction-to-index-buffer-objects-ibos/ So I expect the resulting mesh to get painted like: a----b----c | /| /| | / | / | | / | / | |/ |/ | d----e----f | /| /| | / | / | | / | / | |/ |/ | g----h----i by painting it as described using: glDrawElements(GL_LINE_STRIP, indexCount, GL_UNSIGNED_SHORT, 0); ...since I expect GL_Line_Strip to paint first a line from (a-d), then from (d-b), then (b, e)... and so on (as specified in the indices calculation) But what actually gets painted is: *----*----* |\ |\ | | \ | \ | | \ | \ | | \| \| *----*----* |\ |\ | | \ | \ | | \ | \ | | \| \| *----*----* So the triangles are somehow painted in the wrong order and I need to know why? ;). Does somebody know? Does the problem lie in using GL_Line_Strip or is there a bug in my code? My eye is at (0.0f, 0.0f, 20.0f) and looks at (0,0,0). The mesh is painted along the x-axis & y-axis from left to right with z = 0, so the mesh should not be flipped or anything.

    Read the article

  • Possible to reverse order of ItemGroup elements?

    - by Filburt
    In MSBuild 3.5, is it possible to reverse the order elements in an ItemGroup? Example I have 2 projects. One can be built independently the other is dependent on the first. Each project references its specific items in a .targets file. project_A.targets <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup> <AssembliesToRemove Include="@(AssembliesToRemove)" /> <AssembliesToRemove Include="Assembly_A.dll"> <ApplicationName>App_A</ApplicationName> </AssembliesToRemove> </ItemGroup> <ItemGroup> <AssembliesToDeploy Include="@(AssembliesToDeploy)" /> <AssembliesToDeploy Include="Assembly_A.dll"> <AssemblyType>SomeType</AssemblyType> <ApplicationName>App_A</ApplicationName> </AssembliesToDeploy> </ItemGroup> </Project> project_B.targets <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup> <AssembliesToRemove Include="@(AssembliesToRemove)" /> <AssembliesToRemove Include="Assembly_B.dll"> <ApplicationName>App_B</ApplicationName> </AssembliesToRemove> </ItemGroup> <ItemGroup> <AssembliesToDeploy Include="@(AssembliesToDeploy)" /> <AssembliesToDeploy Include="Assembly_B.dll"> <AssemblyType>SomeType</AssemblyType> <ApplicationName>App_B</ApplicationName> </AssembliesToDeploy> </ItemGroup> </Project> project_A.proj <Project DefaultTargets="Start" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Import Project="project_A.targets" /> <Import Project="Common.targets" /> </Project> project_B.proj <Project DefaultTargets="Start" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Import Project="project_A.targets" /> <Import Project="project_B.targets" /> <Import Project="Common.targets" /> </Project> The Problem In this scenario the problem arises during the Task processing @(AssembliesToDeploy) because Assembly_B.dll needs to be deployed before Assembly_A.dll. What I tried to do I tried to influence the order of @(AssembliesToDeploy) by modifying project_B.targets like this: <ItemGroup> <AssembliesToDeploy Include="Assembly_B.dll"> <AssemblyType>SomeType</AssemblyType> <ApplicationName>App_B</ApplicationName> </AssembliesToDeploy> <AssembliesToDeploy Include="@(AssembliesToDeploy)" /> </ItemGroup> but when using project_B.targets inside project_B.proj the order inside @(AssembliesToDeploy) still remained Assembly_A.dll;Assembly_B.dll. Is there a solution which would allow to reuse my .targets i.e not copying all ItemGroup elements to all .targets files?

    Read the article

  • Change columns order in bootstrap 3

    - by TNK
    I am trying to change bootstrap columns order in desktop and mobile screen. <div class="container"> <div class="row"> <section class="content-secondary col-sm-4"> <h4>Don't Miss!</h4> <p>Suspendisse et arcu felis, ac gravida turpis. Suspendisse potenti. Ut porta rhoncus ligula, sed fringilla felis feugiat eget. In non purus quis elit iaculis tincidunt. Donec at ultrices est.</p> <p><a class="btn btn-primary pull-right" href="#">Read more <span class="icon fa fa-arrow-circle-right"></span></a></p> <h4>Check it out</h4> <p>Suspendisse et arcu felis, ac gravida turpis. Suspendisse potenti. Ut porta rhoncus ligula, sed fringilla felis feugiat eget. In non purus quis elit iaculis tincidunt. Donec at ultrices est.</p> <p><a class="btn btn-primary pull-right" href="#">Read more <span class="icon fa fa-arrow-circle-right"></span></a></p> <h4>Finally</h4> <p>Suspendisse et arcu felis, ac gravida turpis. Suspendisse potenti. Ut porta rhoncus ligula, sed fringilla felis feugiat eget. In non purus quis elit iaculis tincidunt. Donec at ultrices est.</p> <p><a class="btn btn-primary pull-right" href="#">Read more <span class="icon fa fa-arrow-circle-right"></span></a></p> </section> <section class="content-primary col-sm-8"> <div class="main-content" ........... ........... </div> </section> </div><!-- /.row --> </div><!-- /.container --> View Port = SM columns order should be : |content- secondary | content-primary | View Port < SM columns order should be : | content-primary | |content- secondary | I tried it something like this using 'pulland 'push clases. <div class="row"> <section class="content-secondary col-sm-4 col-sm-push-4"> Content ...... </section> <section class="content-primary col-sm-8 col-sm-pull-8"> Content ...... </section> </div> But this is not working for me. Hope someone will help me out. Thank you.

    Read the article

  • MSbuild task fails because "Any CPU" solution is built out of order

    - by Art Vandalay
    I have two solutions to build in Teambuild, one is the application itself, the other one is the WiX installer. I want to build the application using "Any CPU" build configuration and the installer using "x86". I've listed the "Any CPU" solution first in my project file, but Teambuild always builds the "x86" solution first. I'm setting BuildSolutionsInParallel = false, but it still builds the solutions in the reverse listed order. If I change the first solution to "Mixed Platform", it works fine. How can I get the solutions to build in the order listed in the project file? <Project ...> <PropertyGroup> <!-- We want to build the install solution after the build solution --> <BuildSolutionsInParallel>false</BuildSolutionsInParallel> </PropertyGroup> <ItemGroup> <SolutionToBuild Include="$(BuildProjectFolderPath)/Pricer/Pricer.sln"> <Targets></Targets> <Properties></Properties> </SolutionToBuild> <SolutionToBuild Include="$(BuildProjectFolderPath)/Pricer/Pricer.Install/Pricer.Install.sln"> <Targets></Targets> <Properties></Properties> </SolutionToBuild> </ItemGroup> <ItemGroup> <ConfigurationToBuild Include="Release|Any CPU"> <FlavorToBuild>Release</FlavorToBuild> <PlatformToBuild>Any CPU</PlatformToBuild> </ConfigurationToBuild> <ConfigurationToBuild Include="Release|x86"> <FlavorToBuild>Release</FlavorToBuild> <PlatformToBuild>x86</PlatformToBuild> </ConfigurationToBuild> </ItemGroup> </Project>

    Read the article

  • cells order changes in UITableView after reloadSections: method

    - by user304895
    I'm having a problem using a grouped UITableView, and after 3 days of searching, I didn't found the solution... Actually, I have a Grouped table, composed of two sections : The first section contains a UISegmentedControl with three buttons : button0, button1 and button2. When clicking on the button0, I want to show two cells in the second section, with embedded UITextField in each cell. When clicking on the button1, I want to show one cell in the second section with an embedded UITextField. When clicking on the button2, I have to show the camera in ModalView (I think it will be ok). I've also put placeholders in each UITextField. Each time a button is clicked, I call a pickOne: method in order to update my view. In this method, I construct a NSIndexSet with NSRange of (1, 1), and then I call the reloadSections: method from the UITableViewController with NSIndexSet as a parameter. When the view appears for the first time, everything is ok, but when I click many times on the buttons, the order of the cells changes (cells containing the two textFields for the button0), and the new placeHolders are written over the old ones. Even more, sometimes when I click on the button0, it shows me only the second cell... Do you have any idea ? or need some code ? Thank you :)

    Read the article

  • CSS semantics; selecting elements directly or via order

    - by Joshua Cody
    Perhaps this question has been asked elsewhere, but I'm unable to find it. With HTML5 and CSS3 modules inching closer, I'm getting interested in a discussion about the way we write CSS. Something like this where selection is done via element order and type is particularly fascinating. The big advantage to this method seems to be complete modularization of HTML and CSS to make tweaks and redesigns simpler. At the same time, semantic IDs and classes seem advantageous for sundry reasons. Particularly, direct linking, JS targeting, and shorter CSS selectors. Also, it seems selector length might be an issue. For instance, I just wrote the following, which would be admittedly easier using some semantic HTML5 elements: body>div:nth-child(2)>div:nth-child(2)>ul:nth-child(2)>li:last-child So what say you, Stack Overflow? Is the future of CSS writing focused on element order and type? Or are IDs and classes and the current ways here to stay? (I'm well aware the IDs and classes have their place, although I am interested to hear more ways you think they'll continue to be necessary. The discussion I'm interested in is bigger-picture and the ways writing CSS is changing.)

    Read the article

< Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >