Search Results

Search found 45193 results on 1808 pages for 'select call'.

Page 47/1808 | < Previous Page | 43 44 45 46 47 48 49 50 51 52 53 54  | Next Page >

  • GROUP BY as a way to pick the first row from a group of similar rows, is this correct, is there any

    - by FipS
    I have a table which stores test results like this: user | score | time -----+-------+------ aaa | 90% | 10:30 bbb | 50% | 9:15 *** aaa | 85% | 10:15 aaa | 90% | 11:00 *** ... What I need is to get the top 10 users: user | score | time -----+-------+------ aaa | 90% | 11:00 bbb | 50% | 9:15 ... I've come up with the following SELECT: SELECT * FROM (SELECT user, score, time FROM tests_score ORDER BY user, score DESC, time DESC) t1 GROUP BY user ORDER BY score DESC, time LIMIT 10 It works fine but I'm not quite sure if my use of ORDER BY is the right way to pick the first row of each group of sorted records. Is there any better practice to achieve the same result? (I use MySQL 5)

    Read the article

  • Gridview delete/edit not working when using select parameter

    - by Brian Carroll
    new to ASP.NET. I created a sqldatasource and set up basic select query (SELECT * FROM Accounts) using the wizard. I then had the sqldatasource wizard create the INSERT, EDIT and DELETE queries. Connected this datasource to a gridview with EDITING and DELETING enabled. Everything works fine. The SELECT query returns all records and I can edit/delete them. Now I need to send a parameter to the SELECT command to filter the records to those with the user's id (pulled from Membership.GetUser). When I add this parameter, the SELECT command works fine, but the EDIT/DELETE buttons in the gridview no longer work. No error is generated. The page refreshes but the records were not updated in the database. I don't understand what is wrong. CODE: <% Dim u As MembershipUser Dim userid As String u = Membership.GetUser(User.Identity.Name) userid = u.ProviderUserKey.ToString SqlDataSource1.SelectParameters("UserId").DefaultValue = userid %> <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="ID" DataSourceID="SqlDataSource1"> <Columns> <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" /> <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" ReadOnly="True" SortExpression="ID" /> <asp:BoundField DataField="UserId" HeaderText="UserId" SortExpression="UserId" /> <asp:BoundField DataField="AccountName" HeaderText="AccountName" SortExpression="AccountName" /> <asp:BoundField DataField="DateAdded" HeaderText="DateAdded" SortExpression="DateAdded" /> <asp:BoundField DataField="LastModified" HeaderText="LastModified" SortExpression="LastModified" /> </Columns> </asp:GridView> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:CheckingConnectionString %>" DeleteCommand="DELETE FROM [Accounts] WHERE [ID] = @ID" InsertCommand="INSERT INTO [Accounts] ([UserId], [AccountName], [DateAdded], [LastModified]) VALUES (@UserId, @AccountName, @DateAdded, @LastModified)" SelectCommand="SELECT * FROM [Accounts] WHERE [UserId] = @UserId" UpdateCommand="UPDATE [Accounts] SET [UserId] = @UserId, [AccountName] = @AccountName, [DateAdded] = @DateAdded, [LastModified] = @LastModified WHERE [ID] = @ID"> <DeleteParameters> <asp:Parameter Name="ID" Type="Int32" /> </DeleteParameters> <InsertParameters> <asp:Parameter Name="UserId" Type="String" /> <asp:Parameter Name="AccountName" Type="String" /> <asp:Parameter Name="DateAdded" Type="DateTime" /> <asp:Parameter Name="LastModified" Type="DateTime" /> </InsertParameters> <UpdateParameters> <asp:Parameter Name="UserId" Type="String" /> <asp:Parameter Name="AccountName" Type="String" /> <asp:Parameter Name="DateAdded" Type="DateTime" /> <asp:Parameter Name="LastModified" Type="DateTime" /> <asp:Parameter Name="ID" Type="Int32" /> </UpdateParameters> <SelectParameters> <asp:Parameter Name="UserId"/> </SelectParameters> </asp:SqlDataSource>

    Read the article

  • I DISTINCTly hate MySQL (help building a query)

    - by Alex Mcp
    This is staight forward I believe: I have a table with 30,000 rows. When I SELECT DISTINCT 'location' FROM myTable it returns 21,000 rows, about what I'd expect, but it only returns that one column. What I want is to move those to a new table, but the whole row for each match. My best guess is something like SELECT * from (SELECT DISTINCT 'location' FROM myTable) or something like that, but it says I have a vague syntax error. Is there a good way to grab the rest of each DISTINCT row and move it to a new table all in one go?

    Read the article

  • jQuery AJAX & Multiple sp Result Sets

    - by Kevin
    Is it possible to use a stored procedure that returns multiple result sets in json format and process them as part of one request using ajax calls in jquery? In other words, I have a stored procedure that returns several result sets that are to be used with a series of select boxes that are all being filtered by the same criteria. If any of the select boxes is chosen that value is then passed to the stored procedure and all the subsequent select box updates reflect only results that match the filtered criteria. I don't want to have to call the same sp multiple times to process the results and was trying not to create multiple queries, so I'm wondering if it's possible to store more than one json result in a single request and then store and process them on the client side.

    Read the article

  • How to make <option selected="selected"> set by MySql and PHP?

    - by Binyamin
    How to make <option selected="selected"> set by MySql and PHP? My code: echo '<select>'; $tempholder = array(); $rs = mysql_query("SELECT * FROM id ORDER BY year"); $nr = mysql_num_rows($rs); for ($i=0; $i<$nr; $i++){ //if($year=$r["year"]){ $selected=' selected="selected"'; }//doesn't work so $r = mysql_fetch_array($rs); if (!in_array($r['year'], $tempholder)){ $tempholder[$i] = $r['year']; echo "<option>".$r["year"]."</option>";//<option$selected>... } } unset($tempholder); echo '</select>';

    Read the article

  • How to order by results from 2 seperate tables in PHP and MySQL.

    - by Vafello
    I am trying to output results of 2 sql queries to one JSON file. The problem is that I would like to order them ascending by distance which is the result of equation that takes homelat and homelon from the users table and lat, lng from locations table.(basically it takes lattitude and longitude of one point and another and computes the distance between these points). Is it possible to take some parameters from both select queries, compute it and output the result in ascending order? $wynik = mysql_query("SELECT homelat, homelon FROM users WHERE guid='2'") or die(mysql_error()); ; $query = "SELECT * FROM locations WHERE timestamp"; $result = map_query($query); $points = array(); while ($aaa = mysql_fetch_assoc($wynik)) { while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { array_push($points, array('name'=>$row['name'], 'lat'=>$row['lat'], 'lng'=>$row['lng'], 'description'=>$row['description'], 'eventType'=>$row['eventType'], 'date'=>$row['date'], 'isotime'=>date('c', ($row['timestamp'])), 'homelat'=>$aaa['homelat'], 'homelon'=>$aaa['homelon'])); } echo json_encode(array("Locations"=>$points));

    Read the article

  • Objective-C and Cocoa : crash when calling a class function without entering the function

    - by Oliver
    Hello, I have a class function (declared and implemented) in a class MyUtils : + (NSString*) theFunction:(NSString*)param1 param2:(NSString*)param2 param3:(NSString*)param3; When I call this function, with : NSString *item = [MyUtils theFunction:@"abc" param2:aPreviousNSString param3:@"xyz"; my app crashes. In the debugger I have a breakpoint on the first action of the "theFunction" function. And this breakpoint is never reached. If I replace the call by NSString *item = @"youyou"; then everything is ok. Forcing a retain on aPreviousNSString before the call does not change anything. Do you have an idea of what is happening ? Thanks

    Read the article

  • how to get option title="sample" using jquery

    - by tom
    Hi, I'm trying to update a hidden field based on the a title attribute on a select option, I've tried the code bellow and can't seem to get it to work. Thanks for any help! <form> <select id="selectbox"> <option name="test" value="one" title="title" selected="selected">one</option> <option name="test2" value="two" title="title2">two</option> </select> </form> <input id="update" type="hidden" value="defaultold" /> <script> $('#update').val('default'); $('#selectbox').change(function() { $('#update').val($(this).attr("title")); }); </script>

    Read the article

  • Grabbing the right record in a drop down from mysql

    - by 86Stang
    I'm using a form where the user can edit an entry. Everything is populating and all is well with the exception that I can't get the drop down to show the project that they've already assigned the image to. $project_qry = "SELECT * from projects ORDER BY title ASC"; $project_res = mysql_query($project_qry); $project_drop = "<select name=\"project_id\">\n"; while ($row = mysql_fetch_array($project_res)) { if ($project_id == $row[title]) { $project_drop .= "<option value=\"$row[id]\" selected>$row[title]</option>\n"; } else { $project_drop .= "<option value=\"$row[id]\">$row[title]</option>\n"; } } $project_drop .= "</select>\n"; I'm sure it's something devilishly simple but I'm stumped.

    Read the article

  • Call 'script' command and exit it from within a bash script

    - by William Jamieson
    I'm using the linux 'script' command http://www.linuxcommand.org/man_pages/script1.html to log all input and output in an interactive bash script. At the moment I have to call the script command, then run my bash script, then exit. I want to run the script and exit commands from within the actual bash script itself. How can I do this? I've tried script -a but that doesn't work for interactive scripts. Any assistance would be greatly appreciated.

    Read the article

  • Monitoring MySQL SELECT/WRITE/UPDATE/SLOW queries in Nagios

    - by imaginative
    There's ways to get performance graphs with several monitoring software packages out there such as ZenOSS. There's a plugin available that will graph MySQL based SELECT/WRITE/SLOW queries in a nice rrd style graph. I'm curious if there is a way to also get similar graphs available in Nagios 3.0? I know Nagios has tools like pnp and can integrate rrd, but is there something readily available that can plugin to monitor those MySQL specifics?

    Read the article

  • Suggestions for Scheduled Tasks to call OSQL without hard-coding cleartext password

    - by Ian Boyd
    Can anyone think of any techniques where i can have a Windows scheduled task run OSQL, but not have to pass the clear-text password with cleartext password being in the clear? E.g.: >osql -U iboyd -P BabyBatterStapleCorrect Assumption: No Windows Authentication (since it's not an option) i was hoping there was a >OSQL -encryptPassword "BabyBatterStapleCorrect" > > OSQL > Encrypted password: WWVzIGkgd2FudCB0byByYXBlIGJhYmllcy4gQmlnIHdob29wLiBXYW5uYSBmaWdodCBhYm91dCBpdD8= And then i could call OSQL with: >osql -U ian -P WWVzIGkgd2FudCB0byByYXBlIGJhYmllcy4gQmlnIHdob29wLiBXYW5uYSBmaWdodCBhYm91dCBpdD8= But that's not something Microsoft implemented.

    Read the article

  • script to recursively check for and select dependencies

    - by rp.sullivan
    I have written a script that does this but it is one of my first scripts ever so i am sure there is a better way:) Let me know how you would go about doing this. I'm looking for a simple yet efficient way to do this. Here is some important background info: ( It might be a little confusing but hopefully by the end it will make sense. ) 1) This image shows the structure/location of the relevant dirs and files. 2) The packages.file located at ./config/default/config/packages is a space delimited file. field5 is the "package name" which i will call $a for explanations sake. field4 is the name of the dir containing the $a.dir i will call $b field1 shows if the package is selected or not, "X"(capital x) for selected and "O"(capital o as in orange) for not selected. Here is an example of what the packages.file might contain: ... X ---3------ 104.800 database gdbm 1.8.3 / base/library CROSS 0 O -1---5---- 105.000 base libiconv 1.13.1 / base/tool CROSS 0 X 01---5---- 105.000 base pkgconfig 0.25 / base/tool CROSS 0 X -1-3------ 105.000 base texinfo 4.13a / base/tool CROSS DIETLIBC 0 O -----5---- 105.000 develop duma 2_5_15 / base/development CROSS NOPARALLEL 0 O -----5---- 105.000 develop electricfence 2_4_13 / base/development CROSS 0 O -----5---- 105.000 develop gnupth 2.0.7 / extra/development CROSS NOPARALLEL FPIC-QUIRK 0 ... 3) For almost every package listed in the "packages.file" there is a corresponding ".cache file" The .cache file for package $a would be located at ./package/$b/$a/$a.cache The .cache files contain a list of dependencies for that particular package. Here is an example of one of the .cache files might look like. Note that the dependencies are field2 of lines containing "[DEP]" These dependencies are all names of packages in the "package.file" [TIMESTAMP] 1134178701 Sat Dec 10 02:38:21 2005 [BUILDTIME] 295 (9) [SIZE] 11.64 MB, 191 files [DEP] 00-dirtree [DEP] bash [DEP] binutils [DEP] bzip2 [DEP] cf [DEP] coreutils ... So with all that in mind... I'm looking for a shell script that: From within the "main dir" Looks at the ./config/default/config/packages file and finds the "selected" packages and reads the corresponding .cache Then compiles a list of dependencies that excludes the already selected packages Then selects the dependencies (by changing field1 to X) in the ./config/default/config/packages file and repeats until all the dependencies are met Note: The script will ultimately end up in the "scripts dir" and be called from the "main dir". If this is not clear let me know what need clarification. For those interested I'm playing around with T2 SDE. If you are into playing around with linux it might be worth taking a look.

    Read the article

  • Trace linux bash call

    - by jex
    I was wondering if there is a way to trace where a command was run from in Linux. For example, if I call a script, is there any way to trace where it was called from, like started from a program or another bash script.

    Read the article

  • Are there any Acrobat plugins or standalone programs that allow one to select and extract individual

    - by user30525
    We use BCL Jade currently but are running into problems because it isn't supported or sold anymore, doesn't work on Acrobat 8 or 9, and has some other issues. Other than that though it works great! :) Is there anything like it that allows users to select zones to extract? I see a simaler question on here and and an answer that suggests this http://pdftohtml.sourceforge.net/ but ideally we would want something nonprogrammers could use.

    Read the article

  • Read/Select:Connection reset by peer (10054) during remote logoff in RealVNC

    - by Santhosh
    I am using RealVNC 4.5 Enterprise on my Windows 7 client. I use this to connect to a remote system which is also running RealVNC 4.5 (on Windows 7 again). And then i logoff the remote system (server) and all of a sudden the realvnc viewer on the client closes with the message : "Read/Select:Connection reset by peer (10054)" It also asks if i want to reconnect again. Any idea why this is happening and how do i resolve this?

    Read the article

  • OneNote 2010 shortcut to select Pen #1, OR shortcut to access "Quick Access Toolbar"

    - by bobobobo
    Can you assign a keyboard shortcut to the commands you've placed in OneNote 2010's "Quick Access Toolbar"? CTRL+1, CTRL+2 or something.. What I really want to do is have a keyboard shortcut to select Pen #1, Pen #2 etc, but since I placed the pens in the "Quick Access Toolbar" I'd be happy if I could type a keyboard shortcut to access those. This is a pretty comprehensive list of known shortcuts

    Read the article

  • Read/Select:Connection reset by peer (10054) during remote logoff in RealVNC

    - by Santhosh
    I am using RealVNC 4.5 Enterprise on my Windows 7 client. I use this to connect to a remote system which is also running RealVNC 4.5 (on Windows 7 again). And then i logoff the remote system (server) and all of a sudden the realvnc viewer on the client closes with the message : "Read/Select:Connection reset by peer (10054)" It also asks if i want to reconnect again. Any idea why this is happening and how do i resolve this?

    Read the article

  • How to open the Select Users, Computers, Service Accounts or Groups

    - by Dave Rook
    The only way I know how to open the Select Users, Computers, Service Accounts or Groups is by right clicking on a folder and selecting Properties - Security Tab - Edit - Advanced. Below is a screen shot of the window I want to access: Is there any other way to view the full list (Find Now)? I am writing documentation and I want the user to check if a user exists before creating it. I would ideally like them to access this via control panel or similar.

    Read the article

  • Call out to script to stop with attribute in wWWHomePage

    - by Steven Maxon
    I'm getting an error when I try and call out the script to stop in line 8 'Bind to the user object using the current user Set objSysInfo = CreateObject("ADSystemInfo") strUserDN = objSysInfo.UserName Set objUser = GetObject("LDAP://" & strUserDN) strwWWHomePage = objItem.Get("wWWHomePage") If wWWHomePage < 6 Then wscript.quit Else Set ppt = CreateObject("PowerPoint.Application") ppt.Visible = True ppt.Presentations.Open "\abngan01\tracking\ppt.pptx" End If

    Read the article

  • Select part of a text that exists already in an above cell

    - by pragadheesh
    How do I get Excel to partially auto-complete a word using another that already exist in the same worksheet? Let's say I have the word "Microsoft" in a cell and in the cell below I want to type the word "Microhard". When I start typing Microhard, the word Microsoft appears shaded in black. How can I select the "Micro" part alone from Microsoft and continue to fill out the rest with "hard" without it trying to fill out as Microsoft?

    Read the article

< Previous Page | 43 44 45 46 47 48 49 50 51 52 53 54  | Next Page >