Search Results

Search found 26283 results on 1052 pages for 'temporary table'.

Page 111/1052 | < Previous Page | 107 108 109 110 111 112 113 114 115 116 117 118  | Next Page >

  • How to select the most recent set of dated records from a mysql table

    - by Ken
    I am storing the response to various rpc calls in a mysql table with the following fields: Table: rpc_responses timestamp (date) method (varchar) id (varchar) response (mediumtext) PRIMARY KEY(timestamp,method,id) What is the best method of selecting the most recent responses for all existing combinations of method and id? For each date there can only be one response for a given method/id. Not all call combinations are necessarily present for a given date. There are dozens of methods, thousands of ids and at least 356 different dates Sample data: timestamp method id response 2009-01-10 getThud 16 "....." 2009-01-10 getFoo 12 "....." 2009-01-10 getBar 12 "....." 2009-01-11 getFoo 12 "....." 2009-01-11 getBar 16 "....." Desired result: 2009-01-10 getThud 16 "....." 2009-01-10 getBar 12 "....." 2009-01-11 getFoo 12 "....." 2009-01-11 getBar 16 "....." (I don't think this is the same question - it won't give me the most recent response)

    Read the article

  • Help with an SQL query on a single (comments) table (screenshot included)

    - by citrus
    Please see screenshot Goal: id like to have comments nested 1 level deep The comments would be arranged so that rating of the parent is in descending order the rating of the children comments is irrelevant The left hand side of the screenshot shows the output that Id like. The RHS shows the table data. All of the comments are held in 1 table. Im a beginner with SQL queries, the best I can do is: SELECT * FROM [Comments] WHERE ([ArticleId] = @ArticleId) ORDER BY [ThreadId] DESC, [DateMade] This somewhat does the job, but it obviously neglects the rating. So the above statement would show output where Bobs Comment and all of the children comments are before Amy's and her childrens comments. How can I run this query correctly?

    Read the article

  • reloading table

    - by edie
    Hi... I've have a table view that consist of item list that depends on the item that were purchased using in app purchasing. My question was how can I reload the tableView when the purchasing was completed/(or when new item was added on my list). The response of the storekit takes time to complete. Are there anyways to tell the app that the purchasing was completed and new item was added on my list so that I can reload my tableView. At this time I reloading my table view by adding [myTableView reloadData] in viewWillAppear method. But what if the user was already viewing the tableView, I can't reload the tableView because the viewWillAppear had passed. thanks...

    Read the article

  • storing image_id after uploading image in article table

    - by Bader
    According to this question i successed to create upload image , but now i need to store the image_id to another table called articles , i do not know if this is correct , but i tried to select the image_id from table image like this $select_image=mysql_query("select image_id from image where image_name = $fileName") or die(mysql_error()); and fetch the result to my article insert query like this $fetch=mysql_fetch_array($select_image); $qeuery=mysql_query("insert into articles (article_name,article_category,article_subcategory,article_body,article_summary,article_tags,article_photo,article_timedate) values ('$article_title','$CategoryID','$ProductID','$article_body','$article_summary','$fetch[image_id]','$time')") or die ('Error, Query Faild'.mysql_error()); is this correct ? the mysql_error keeps saying " Unknown column 'Penguins.jpg' in 'where clause'"

    Read the article

  • Left Join works with table but fails with query

    - by Frank Martin
    The following left join query in MS Access 2007 SELECT Table1.Field_A, Table1.Field_B, qry_Table2_Combined.Field_A, qry_Table2_Combined.Field_B, qry_Table2_Combined.Combined_Field FROM Table1 LEFT JOIN qry_Table2_Combined ON (Table1.Field_A = qry_Table2_Combined.Field_A) AND (Table1.Field_B = qry_Table2_Combined.Field_B); is expected by me to return this result: +--------+---------+---------+---------+----------------+ |Field_A | Field_B | Field_A | Field_B | Combined_Field | +--------+---------+---------+---------+----------------+ |1 | | | | | +--------+---------+---------+---------+----------------+ |1 | | | | | +--------+---------+---------+---------+----------------+ |2 |1 |2 |1 |John, Doe | +--------+---------+---------+---------+----------------+ |2 |2 | | | | +--------+---------+---------+---------+----------------+ [Table1] has 4 records, [qry_Table2_Combined] has 1 record. But it gives me this: +--------+---------+---------+---------+----------------+ |Field_A | Field_B | Field_A | Field_B | Combined_Field | +--------+---------+---------+---------+----------------+ |2 |1 |2 |1 |John, Doe | +--------+---------+---------+---------+----------------+ |2 |2 |2 | |, | +--------+---------+---------+---------+----------------+ Really weird is that the [Combined_Field] has a comma in the second row. I use a comma to concatenate two fields in [qry_Table2_Combined]. If the left join query uses a table created from the query [qry_Table2_Combined] it works as expected. Why does this left join query not give the same result for a query and a table? And how can i get the right results using a query in the left join?

    Read the article

  • HD Crash SQL server -> DBCC - consistency errors in table 'sysindexes'

    - by Julian de Wit
    Hello A client of mine has had an HD crash an a SQL DB got corrupt : They did not make backups so they have a big problem. When I tried (an ultimate measure) to DBCC-repair I got the following message. Can anybody help me with this ? Server: Msg 8966, Level 16, State 1, Line 1 Could not read and latch page (1:872) with latch type SH. sysindexes failed. Server: Msg 8944, Level 16, State 1, Line 1 Table error: Object ID 2, index ID 0, page (1:872), row 11. Test (columnOffsets->IsComplex (varColumnNumber) && (ColumnId == COLID_HYDRA_TEXTPTR || ColumnId == COLID_INROW_ROOT || ColumnId == COLID_BACKPTR)) failed. Values are 2 and 5. The repair level on the DBCC statement caused this repair to be bypassed. CHECKTABLE found 0 allocation errors and 1 consistency errors in table 'sysindexes' (object ID 2). DBCC execution completed. If DBCC printed error messages, contact your system administrator.

    Read the article

  • Recommendation of Jquery Table pager plugin?

    - by chobo2
    Hi I was trying to use the pager plugin that comes with the tablesorter plugin but I can't get it to work as you can see from my previous post http://stackoverflow.com/questions/2836680/need-help-with-jquery-tablesorter-pager-plugin. I given up on this plugin as no one can seem to come up with a solution how to make it work and I kinda need to get this place soon. So now I am looking for a new one but it must have the following features. Work on tables Work on tables that have the tablesorter 2.0 plugin on it( so I don't want a pager plugin that comes with its own table sorter since I don't want to change that. It should be a standalone pager plugin). Be able to add rows dynamically to the table and some how update the pager so this row now becomes part of the pager. Thanks

    Read the article

  • Printing All Entries in A PHP Table

    - by mgunawan
    I'm trying to insert a php excerpt with SQL (I understand this is outdated, but am trying to grasp the syntax first) into my HTML page, and I've got the following table: ID Name Element1 Element2 0 John John's 1st John's 2nd 1 Bill Bill's 1st Bill's 2nd 2 Steve Steven's 1st Steve's 2nd I'm trying to get the for loop that will essentially print out the following in my html page Name: Name where ID=0 Element1: Element1 where ID=0 Element2: Element2 where ID=0 Name: Name where ID=1 Element1: Element1 where ID=1 Element2: Element2 where ID=1 and so forth. Basically, I am trying to make this process automated so that whenever a new record is added into the table, the HTML page will automatically update with a new "profile". Thank you for your help!

    Read the article

  • Custom OData operation / customize EF model to hide join table in many-to-many relationship

    - by AC
    I've got a data model that has two tables with a join table for a many to many relationship & creating an OData service to expose the data for CRUD ops in a Silverlight app. What I'd like to do is abstract the join table from the service. I'm not sure if the best way to do this would be in the model (using EF in .NET3.5SP1) or if I should do it with a custom service operation. If I do it in the EF model (not sure how I'd do this), then the OOTB WCF Data Service stuff would make it easy to say [..]/Courses(1)/Modules ... otherwise I'd have to create a custom operation to do this. Is it possible to do this in the EF model and if so, how does that work?

    Read the article

  • SQLite not pluralizing Table Names

    - by weenet
    I am using SQLite as my db during development, and I want to postpone actually creating a final database until my domains are fully mapped. So I have this in my Global.asax.cs file: private void InitializeNHibernateSession() { Configuration cfg = NHibernateSession.Init( webSessionStorage, new [] { Server.MapPath("~/bin/MyNamespace.Data.dll") }, new AutoPersistenceModelGenerator().Generate(), Server.MapPath("~/NHibernate.config")); if (ConfigurationManager.AppSettings["DbGen"] == "true") { var export = new SchemaExport(cfg); export.Execute(true, true, false, NHibernateSession.Current.Connection, File.CreateText(@"DDL.sql")); } } The AutoPersistenceModelGenerator hooks up the various conventions, including a TableNameConvention like so: public void Apply(FluentNHibernate.Conventions.Instances.IClassInstance instance) { instance.Table(Inflector.Net.Inflector.Pluralize(instance.EntityType.Name)); } This is working nicely execpt that the sqlite db generated does not have pluralized table names. Any idea what I'm missing? Thanks.

    Read the article

  • Delete object[i] from table or group in corona sdk

    - by Rober Dote
    i have a problem (obviusly :P) i'm create a mini game, and when i touch a Object-A , creates an Object-B. If i touch N times, this create N Object-B. (Object-B are Bubbles in my game) so, i try when I touch the bubble (object-B), that disappears or perform any actions. I try adding Object-B to Array local t = {} . . . bur = display.newImage("burbuja.png") table.insert(t,bur) and where i have my eventListeners i wrote: for i=1, #t do bur[i]:addEventListener("tap",reventar(i)) end and my function 'reventar' local function reventar (event,id) table.remove(t,id) end i'm lost, and only i want disappears the bubbles.

    Read the article

  • Using T-Sql, how can I insert from one table on a remote server into another table on my local server?

    - by GenericTypeTea
    Given the remote server 'Production' (currently accessible via an IP) and the local database 'Development', how can I run an INSERT into 'Development' from 'Production' using T-SQL? I'm using MS SQL 2005 and the table structures are a lot different between the two databases hence the need for me to manually write some migration scripts. UPDATE: T-SQL really isn't my bag. I've tried the following (not knowing what I'm doing): EXEC sp_addlinkedserver @server = N'20.0.0.1\SQLEXPRESS', @srvproduct=N'SQL Server' ; GO EXEC sp_addlinkedsrvlogin '20.0.0.1\SQLEXPRESS', 'false', 'Domain\Administrator', 'sa', 'saPassword' SELECT * FROM [20.0.0.1\SQLEXPRESS].[DatabaseName].[dbo].[Table] And I get the error: Login failed for user ''. The user is not associated with a trusted SQL Server connection.

    Read the article

  • PostgreSQL: keep a certain number of records in a table

    - by Alexander Farber
    Hello, I have an SQL-table holding the last hands received by a player in card game. The hand is represented by an integer (32 bits == 32 cards): create table pref_hand ( id varchar(32) references pref_users, hand integer not NULL check (hand > 0), stamp timestamp default current_timestamp ); As the players are playing constantly and that data isn't important (just a gimmick to be displayed at player profile pages) and I don't want my database to grow too quickly, I'd like to keep only up to 10 records per player id. So I'm trying to declare this PL/PgSQL procedure: create or replace function pref_update_game(_id varchar, _hand integer) returns void as $BODY$ begin delete from pref_hand offset 10 where id=_id order by stamp; insert into pref_hand (id, hand) values (_id, _hand); end; $BODY$ language plpgsql; but unfortunately this fails with: ERROR: syntax error at or near "offset" because delete doesn't support offset. Does anybody please have a better idea here? Thank you! Alex

    Read the article

  • Table alias -- Unkown column in field list

    - by Jason
    Hi all, I have a sql query which is executing a LEFT JOIN on 2 tables in which some of the columns are ambiguous. I can prefix the joined tables but when I try to prefix one of the columns from the table in the FROM clause, it tells me Unknown column. I even tried giving that table an alias like so ...From points AS p and using "p" to prefix the tables but that didn't work either. Can someone tell me what I'm doing wrong. Here is my query: SELECT point_title, point_url, address, city, state, zip_code, phone, `points`.`lat`, `points`.`longi`, featured, kmlno, image_url, category.title, category_id, point_id, lat, longi, reviews.star_points, reviews.review_id, count(reviews.point_id) as totals FROM (SELECT *, ( 3959 * acos( cos( radians('37.7717185') ) * cos( radians( lat ) ) * cos( radians( longi ) - radians('-122.4438929') ) + sin( radians('37.7717185') ) * sin( radians( lat ) ) ) ) AS distance FROM points HAVING distance < '25') as distResults LEFT JOIN category USING ( category_id ) LEFT JOIN reviews USING ( point_id ) WHERE (point_title LIKE '%Playgrounds%' OR category.title LIKE '%Playgrounds%') GROUP BY point_id ORDER BY totals DESC, distance LIMIT 0 , 10

    Read the article

  • LuaInterface: add a table to the script scope

    - by user93422
    Question: how can I insert a table from C# into 'LuaInterface' script scope using a C# object (preferably anonymous type)? /// I want to do this, but it does not work /// (complains that 'test' is userdata and not table /// when I pass it to pairs() in the script) //lua["test"] = new { A = 1, B = 2 }; /// another option /// but building this string is a PITA (actual string is nested and long). lua.DoString("test = { A = 1, B = 2 }"); // So I have to do this lua.NewTable("test"); ((LuaTable) lua["test"])["A"] = 1; ((LuaTable) lua["test"])["B"] = 2; lua.DoString("for k,v in pairs(test) do print(k..': '..v) end");

    Read the article

  • Cakephp with underscore table ignores model

    - by xiaohouzi79
    Hi, I have one table metrics and another table metric_levels. In the Metric model I have $hasMany = 'MetricLevels' but anything inside the MetricLevels model is totally ignored. But, if I rename the model to 'Metric' and have $useTable = 'metric_levels' it works fine. I've tried all combinations, but none seem to work. I've tried plurals, singulars, underscores, nothing seems to work. The model is simply ignored and it just takes the value from the database. Any help is appreciated.

    Read the article

  • Constrain a table to have only one row

    - by finnw
    What's the cleanest way to constrain a SQL table to allow it to have no more than one row? This related question discusses why such a table might exist, but not how the constraint should be implemented. So far I have only found hacks involving a unique key column that is constrained to have a specific value, e.g. ALWAYS_0 TINYINT NOT NULL PRIMARY KEY DEFAULT (0) CONSTRAINT CHECK_ALWAYS_0 CHECK (ALWAYS_0 = 0). I am guessing there is probably a cleaner way to do it. The ideal solution would be portable SQL, but a solution specific to MS SQL Server or postgres would also be useful

    Read the article

  • How to join table to itself and select max values in SQL

    - by Jakub Konop
    I have a contracts table: contractId date price partId 1 20120121 10 1 2 20110130 9 1 3 20130101 15 2 4 20110101 20 2 The contract with greatest date being the active contract (don't blame me, I blame infor for creating xpps) I need to create query to see only active contracts (one contract per part, the contract with highest date). So the result of the query should be like this: contractId date price partId 1 20120121 10 1 3 20130101 15 2 I am out of ideas here, I tried self joining the table, I tried aggregation functions, but I can't figure it out. If anyone would have any idea, please share them with me..

    Read the article

  • Rails: has_many association with a table in another database and without foreign key

    - by Fernando
    Here is my situation. I have model called Account. An account can have one or more contracts. The problem is that i'm dealing with a legacy application and each account's contracts are stored in a different database. Example: Account 1's contract are in account1_db.contracts. Account 2's contract are in account2_db.contracts. The database name is a field stored in accounts table. How can i make rails association work with this? This is a legacy PHP application and i simply can't change it to store everything in one table. I need to make it work somehow. I tried this, but it didn't worked: has_many :contracts, :conditions => [lambda{ Contract.set_table_name(self.database + '.contracts'); return '1' }] Any ideas?

    Read the article

  • In MYSQL is it better to have one big table or many smaller tables

    - by user307922
    Hi All, I am making a database of my client's customers to send email promotions to. The database will include all about 12 of my clients and each of them has an average of 2100 customers. I was wondering if it would be better to have a table in the db for each one of my clients that contains a list of their customers or if I should just make one big table... The customers will be queried daily. I know it is a broad question but any advice would be appreciated. Cheers, Chuck

    Read the article

  • Sql Distinct Count of resulting table with no conditionals

    - by AfterImage
    Hello everyone, I want to count the number of accounts from the resulting table generated from this code. This way, I know how many people liked blue at one time. Select Distinct PEOPLE.FullName, PEOPLE.FavColor From PEOPLE Where FavColor='Blue' Lets say this is a history accounting of what people said their favorite color when they were asked so there may be multiple records of the same full name if asked again at a much later time; hence the distinct. The code I used may not be reusable in your answer so feel free to use what you think can work. I am sure I found a possible solution to my problem using declare and if statements but I lost that page... so I am left with no solution. However, I think there is a way to do it without using conditionals which is what I am asking and rather have. Thanks. Edit: My question is: From the code above, is there a way to count the number of accounts in the resulting table?

    Read the article

  • How to put PrintWriter object content in to table cell

    - by user3599482
    I have a small problem about a content returning from servlet to put in table cell. In javascript I am calling servlet method using post, it returns some content and I have to put it in two different <td> cells. here is my code, In javascript, $.post('<%=request.getContextPath()%>/controller/UserLockController',{'userName':userName,'status':status}, function(data) { document.getElementById("status_"+userName).innerHTML=data; document.getElementById("td_"+userName).innerHTML=data; }); in servlet it writes as, out.println("<td id=\"status_"+inputParam+"\">Locked</td>"); out.println("<td id=\"td_"+inputParam+"\"><a href=\"#\" class=\"btn btn-sm btn-primary unlockBtn\" id=\"togBtn_"+inputParam+"\" onClick=\"LockAccount('"+inputParam+"','"+status+"')\">UnLock</td>"); Here content is returning but problem is the both <td> return from servlet will fit in single cell of html table. how to solve this please help me.

    Read the article

< Previous Page | 107 108 109 110 111 112 113 114 115 116 117 118  | Next Page >