Search Results

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

Page 76/1052 | < Previous Page | 72 73 74 75 76 77 78 79 80 81 82 83  | Next Page >

  • I need some MySQL lookup table advice

    - by Gary Beam
    I have a MySQL database with about 200 tables. 50 of these are small 2-field 'id-data' lookup tables. Several of these DB's are hosted on a shared server. I have been informed that I need to reduce the total number of tables in the shared hosting environment because of performance issues relating to too many tables. My question is: Could/Should the 50 2-Field lookup tables be combined into a single 3-field table with 'id-field_name-data' Fields? Even if this can be done, I will have a lot of work to do on the PHP user application. My other choice is moving the DB's to a dedicated server at much higher hosting cost. I don't believe my 200 table DB's are actually causing any performance issues on this shared hosting server, at least not from the user application standpoint. There are never more than 10 of these tables joined in any single query; although I have seen some very-slow queries generated by phpmyadmin on these DB's.

    Read the article

  • iptables: built-in INPUT chain in nat table?

    - by ughmandaem
    I have a Gentoo Linux system running linux 2.6.38-rc8. I also have a machine running Ubuntu with linux 2.6.35-27. I also have a virtual machine running Debian Unstable with linux 2.6.37-2. On the Gentoo and Debian systems I have an INPUT chain built into my nat table in addition to PREROUTING, OUTPUT, and POSTROUTING. On Ubuntu, I only have PREROUTING, OUTPUT, and POSTROUTING. I am able to use this INPUT chain to use SNAT to modify the source of a packet that is destined to the local machine (imagine simulating an incoming spoofed IP to a local application or just to test a virtual host configuration). This is possible with 2 firewall rules on Gentoo and Debian but seemingly not so on Ubuntu. I looked around for documentation on changes to the SNAT target and the INPUT chain of the nat table and I couldn't find anything. Does anyone know if this is a configuration issue or is it something that was just added in more recent versions of linux?

    Read the article

  • Routing table with two NIC adapters in libvirt/KVM

    - by lzap
    I created a virtual NAT network (192.168.100.0/24 network) in my libvirt and new guest with two interfaces - one in this network, one as bridged (10.34.1.0/24 network) to the local LAN. The reason for that is I need to have my own virtual network for my DHCP/TFTP/DNS testing and still want to access my guest externally from my LAN. On both networks I have working DHCP, both giving them IP addresses. When I setup NAT port forwarding (e.g. for ssh), I can connect to the eth0 (virtual network), everything is fine. But when I try to access the eth1 via bridged interface, I have no response. I guess I have problem with my routing table - outgoing packets are routed to the virtual NAT network (which has access to the machine I am connecting from - I can ping it). But I am not sure if this setup is correct. I think I need to add something to my routing table. # ifconfig eth0 Link encap:Ethernet HWaddr 52:54:00:B4:A7:5F inet addr:192.168.100.14 Bcast:192.168.100.255 Mask:255.255.255.0 inet6 addr: fe80::5054:ff:feb4:a75f/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:16468 errors:0 dropped:27 overruns:0 frame:0 TX packets:6081 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:22066140 (21.0 MiB) TX bytes:483249 (471.9 KiB) Interrupt:11 Base address:0x2000 eth1 Link encap:Ethernet HWaddr 52:54:00:DE:16:21 inet addr:10.34.1.111 Bcast:10.34.1.255 Mask:255.255.255.0 inet6 addr: fe80::5054:ff:fede:1621/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:34 errors:0 dropped:0 overruns:0 frame:0 TX packets:189 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:4911 (4.7 KiB) TX bytes:9 # route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.100.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 10.34.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1 169.254.0.0 0.0.0.0 255.255.0.0 U 1002 0 0 eth0 169.254.0.0 0.0.0.0 255.255.0.0 U 1003 0 0 eth1 0.0.0.0 192.168.100.1 0.0.0.0 UG 0 0 0 eth0 Network I am trying to connect from is different than network the hypervisor is connected to: 10.36.0.0. But it is accessible from that network. So I tried to add new route rule: route add -net 10.36.0.0 netmask 255.255.0.0 dev eth1 And it is not working. I thought setting correct interface would be sufficient. What is needed to get my packets coming through?

    Read the article

  • How can I generate a list of appendices with LaTeX, seperate from table of contents (toc)

    - by None
    LaTeX' appendix environment formats sections differently and uses a different enumeration in the table of contents: \begin{appendix} \section{superuser} \dots{} .... Shows up as       A       superuser            11 in the \tableofcontents. Unfortunately, I have to use a different style: the appendix is not to show up in the table of contents, but in a seperate listing right before the appendix. I see the following options to solve this: suppress output in tableofcontents and somehow recreate the part on a different page generate a custom listing of specified / the following section manually create a list with the same formatting of the tableofcontents I use scrartcl as document class. PS: appedix / appendices is not a tag yet

    Read the article

  • Word table copy/drag formulae like Excel

    - by tumchaaditya
    I am inserting formulae into a word table to get subtotals for rows and columns and a grand total. My problem is, I have got large number of rows and I don't want to enter the formulae manually in each cell. I cannot use =SUM(LEFT) because the subtotal does not have all the columns. So, is there any way to drag the formulae like we do in excel(bottom right corner of selected cell)? I cannot send the table to excel and copy it back because it would ruin the formatting which took a lot of my time.

    Read the article

  • Powershell access a single value in a table

    - by falkaholic
    this should be a really easy one but i can't seem to find an easy way. For example, in powershell and am using a CSV file, which is then used to look up some configuration data based on an ID. Here is what I have now, it works, but there has got to be a better way. $configList = import-csv "C:\myconfig.csv" $id = "5001" $configList | where-object {$_.id -eq $id} | foreach-object{ $configData = $_.configData} If use format-table etc, I always get the column header, which I would then have to cut off. Again, this has got to be really easy and this isn't a show stopper. But there has to be a better way to get just the data out of a table without the column header.

    Read the article

  • Clean out a large MediaWiki text table

    - by Bart van Heukelom
    I just discovered that an old MediaWiki of mine was infested with spam, and the database table named "text" (which contains the page content) is 3GB large. I've deleted all the spam pages manually, but: The table is still the same size. I wonder how it got to 3GB anyway. There wasn't that much spam (about a hundred medium-sized pages) How can I get rid of this mess? If you want to inspect the wiki, it's over here. The database is MySQL 5.0.75.

    Read the article

  • Filemaker show total from related table

    - by Mr_Chimp
    I have a bit of experience with Access and SQL but I'm new to Filemaker. I have a layout which shows a list of projects. One of the fields I want it to show is "total amount of paid invoices up to the end of the last financial year". The invoices are stored on another table so I will need to pick from this table all records where "project id" = "project id" (this is set up as a relationship between the tables) and also "invoice is paid" = yes AND "date invoice paid" < start of last financial year. My question is how do I go about getting and showing that data? I can get a total easily enough, it's filtering out these specific rows that I'm having trouble with. I'm guessing there's an easy solution...

    Read the article

  • How to lookup a value in a table with multiple criteria

    - by php-b-grader
    I have a data sheet with multiple values in multiple columns. I have a qty and a current price which when multiplied out gives me the current revenue (CurRev). I want to use this lookup table to give me the new revenue (NewRev) from the new price but can't figure out how to do multiple ifs in a lookup. What I want is to build a new column that checks the "Product", "Tier" and "Location/State" and gives me the new price from the lookup table (above) and then multiply that by the qty. e.g. Data > Product, Tier, Location, Qty, CurRev, NewRev > Product1, Tier1, VIC, 2, $1000.00, $6000 (2 x $3000) > Product2, Tier3, NSW, 1, $100.00, $200 (1 x $200) > Product1, Tier3, SA, 5, $250.00, $750 (5 x $150) > Product3, Tier1, ACT, 5, $100.00, $500(5 x $100) > Product2, Tier3, QLD, 2, $150.00, $240 (2 x $240) Worst case, if I just get the new rate I can create another column

    Read the article

  • Table Formatting in Word

    - by user359217
    I have a table in Word which is 5 columns wide and multiple rows. In Row 3, cells 1, 2, 3 & 5 have simple text. Cell 4 contains a large quantity of text and therefore needs to wrap over several pages. Therefore, I mark "Allow row to break across pages". Problem: on next page where row has wrapped, cells 1, 2, 3 & 5 are blank with cell 4 displaying the wrapped text. Is there any way that I can get the simple text from Row 3, cells 1, 2 and 3 to repeat on the pages which contain the wrapped text of cell 4? I do not want the data to be in the table heading, as I have multiple rows which have a similar volume of text.

    Read the article

  • Why SQL2008 debugger would NOT step into a certain child stored procedure

    - by John Galt
    I'm encountering differences in T-SQL with SQL2008 (vs. SQL2000) that are leading me to dead-ends. I've verified that the technique of sharing #TEMP tables between a caller which CREATES the #TEMP and the child sProc which references it remain valid in SQL2008 See recent SO question. My core problem remains a critical "child" stored procedure that works fine in SQL2000 but fails in SQL2008 (i.e. a FROM clause in the child sProc is coded as: SELECT * FROM #AREAS A) despite #AREAS being created by the calling parent. Rather than post snippets of the code now, here is another symptom that may help you suggest something. I fired up the new debugger in SQL Mgmt Studio: EXEC dbo.AMS1 @S1='06',@C1='037',@StartDate='01/01/2008',@EndDate='07/31/2008',@Type=1,@ACReq = 1,@Output = 0,@NumofLines = 30,@SourceTable = 'P',@LoanPurposeCatg='P' This is a very large sProc and the key snippet that is weird is the following: **create table #Areas ( State char(2) , County char(3) , ZipCode char(5) NULL , CityName varchar(28) NULL , PData varchar(3) NULL , RData varchar(3) NULL , SMSA_CD varchar(10) NULL , TypeCounty varchar(50) , StateAbbr char(2) ) EXECUTE dbo.AMS_I_GetAreasV5 -- this child populates #Areas @SMSA = @SMSA , @S1 = @S1 , @C1 = @C1 , @Z1 = @Z1 , @SourceTable = @SourceTable , @CustomID = @CustomID , @UserName = @UserName , @CityName = @CityName , @Debug=0 EXECUTE dbo.AMS_I_GetAreas_FixAC -- this child cannot reference #Areas @StartDate = @StartDate , @EndDate = @EndDate , @SMSA_CD = @SMSA_CD , @S1 = @S1 , @C1 = @C1 , @Z1 = @Z1 , @CityName = @CityName , @CustomID = @CustomID , @Debug=0 -- continuation of the parent sProc** I can step through the execution of the parent stored procedure. When I get to the first child sproc above, I can either STEP INTO dbo.AMS_I_GetAreasV5 or STEP OVER its execution. When I arrive at the invocation of the 2nd child sProc - dbo.AMS_I_GetAreas_FixAC - I try to STEP INTO it (because that is where the problem statement is) and STEP INTO is ignored (i.e. treated like STEP OVER instead; yet I KNOW I pressed F11 not F10). It WAS executed however, because when control is returned to the statement after the EXECUTE, I click Continue to finish execution and the results windows shows the errors in the dbo.AMS_I_GetAreas_FixAC (i.e. the 2nd child) stored procedure. Is there a way to "pre-load" an sProc with the goal of setting a breakpoint on its entry so that I can pursue execution inside it? In summary, I wonder if the inability to step into a given child sproc might be related to the same inability of this particular child to reference a #temp created by its parent (caller).

    Read the article

  • DataMapper and Codeigniter - how to fully manage a many-to-many relationship

    - by user252160
    I have the following relationship CType has many Field Field has many Ctype and of course the tables used are fields, ctypes, and ctypes_fields. Normally, the ctypes_fields table should contain only ids referencing the other two tables. However, i'd like to put there a "options" field that will contain some content for the concrete instance only. I walked through all DataMapper tuts but I could'n find relevant info on how I could extract these specific values (the ones in the relation table) Should I create a separate model for this relation table or there is a clever way to do this ?

    Read the article

  • SQL SERVER – Guest Post by Sandip Pani – SQL Server Statistics Name and Index Creation

    - by pinaldave
    Sometimes something very small or a common error which we observe in daily life teaches us new things. SQL Server Expert Sandip Pani (winner of Joes 2 Pros Contests) has come across similar experience. Sandip has written a guest post on an error he faced in his daily work. Sandip is working for QSI Healthcare as an Associate Technical Specialist and have more than 5 years of total experience. He blogs at SQLcommitted.com and contribute in various forums. His social media hands are LinkedIn, Facebook and Twitter. Once I faced following error when I was working on performance tuning project and attempt to create an Index. Mug 1913, Level 16, State 1, Line 1 The operation failed because an index or statistics with name ‘Ix_Table1_1′ already exists on table ‘Table1′. The immediate reaction to the error was that I might have created that index earlier and when I researched it further I found the same as the index was indeed created two times. This totally makes sense. This can happen due to many reasons for example if the user is careless and executes the same code two times as well, when he attempts to create index without checking if there was index already on the object. However when I paid attention to the details of the error, I realize that error message also talks about statistics along with the index. I got curious if the same would happen if I attempt to create indexes with the same name as statistics already created. There are a few other questions also prompted in my mind. I decided to do a small demonstration of the subject and build following demonstration script. The goal of my experiment is to find out the relation between statistics and the index. Statistics is one of the important input parameter for the optimizer during query optimization process. If the query is nontrivial then only optimizer uses statistics to perform a cost based optimization to select a plan. For accuracy and further learning I suggest to read MSDN. Now let’s find out the relationship between index and statistics. We will do the experiment in two parts. i) Creating Index ii) Creating Statistics We will be using the following T-SQL script for our example. IF (OBJECT_ID('Table1') IS NOT NULL) DROP TABLE Table1 GO CREATE TABLE Table1 (Col1 INT NOT NULL, Col2 VARCHAR(20) NOT NULL) GO We will be using following two queries to check if there are any index or statistics on our sample table Table1. -- Details of Index SELECT OBJECT_NAME(OBJECT_ID) AS TableName, Name AS IndexName, type_desc FROM sys.indexes WHERE OBJECT_NAME(OBJECT_ID) = 'table1' GO -- Details of Statistics SELECT OBJECT_NAME(OBJECT_ID) TableName, Name AS StatisticsName FROM sys.stats WHERE OBJECT_NAME(OBJECT_ID) = 'table1' GO When I ran above two scripts on the table right after it was created it did not give us any result which was expected. Now let us begin our test. 1) Create an index on the table Create following index on the table. CREATE NONCLUSTERED INDEX Ix_Table1_1 ON Table1(Col1) GO Now let us use above two scripts and see their results. We can see that when we created index at the same time it created statistics also with the same name. Before continuing to next set of demo – drop the table using following script and re-create the table using a script provided at the beginning of the table. DROP TABLE table1 GO 2) Create a statistic on the table Create following statistics on the table. CREATE STATISTICS Ix_table1_1 ON Table1 (Col1) GO Now let us use above two scripts and see their results. We can see that when we created statistics Index is not created. The behavior of this experiment is different from the earlier experiment. Clean up the table setup using the following script: DROP TABLE table1 GO Above two experiments teach us very valuable lesson that when we create indexes, SQL Server generates the index and statistics (with the same name as the index name) together. Now due to the reason if we have already had statistics with the same name but not the index, it is quite possible that we will face the error to create the index even though there is no index with the same name. A Quick Check To validate that if we create statistics first and then index after that with the same name, it will throw an error let us run following script in SSMS. Make sure to drop the table and clean up our sample table at the end of the experiment. -- Create sample table CREATE TABLE TestTable (Col1 INT NOT NULL, Col2 VARCHAR(20) NOT NULL) GO -- Create Statistics CREATE STATISTICS IX_TestTable_1 ON TestTable (Col1) GO -- Create Index CREATE NONCLUSTERED INDEX IX_TestTable_1 ON TestTable(Col1) GO -- Check error /*Msg 1913, Level 16, State 1, Line 2 The operation failed because an index or statistics with name 'IX_TestTable_1' already exists on table 'TestTable'. */ -- Clean up DROP TABLE TestTable GO While creating index it will throw the following error as statistics with the same name is already created. In simple words – when we create index the name of the index should be different from any of the existing indexes and statistics. Reference: Pinal Dave (http://blog.SQLAuthority.com) Filed under: PostADay, SQL, SQL Authority, SQL Error Messages, SQL Index, SQL Query, SQL Server, SQL Tips and Tricks, T SQL, Technology Tagged: SQL Statistics

    Read the article

  • Updating records with their subordinates via CTE or subquery

    - by Mike Jolley
    Let's say I have a table with the following columns: Employees Table employeeID int employeeName varchar(50) managerID int totalOrganization int managerID is referential to employeeID. totalOrganization is currently 0 for all records. I'd like to update totalOrganization on each row to the total number of employees under them. So with the following records: employeeID employeeName managerID totalOrganization 1 John Cruz NULL 0 2 Mark Russell 1 0 3 Alice Johnson 1 0 4 Juan Valdez 3 0 The query should update the totalOrganizations to: employeeID employeeName managerID totalOrganization 1 John Cruz NULL 3 2 Mark Russell 1 0 3 Alice Johnson 1 1 4 Juan Valdez 3 0 I know I can get somewhat of an org. chart using the following CTE: WITH OrgChart (employeeID, employeeName,managerID,level) AS ( SELECT employeeID,employeeName,0 as managerID,0 AS Level FROM Employees WHERE managerID IS NULL UNION ALL SELECT Employees.employeeID,Employees.employeeName,Employees.managerID,Level + 1 FROM Employees INNER JOIN OrgChart ON Employees.managerID = OrgChart.employeeID ) SELECT employeeID,employeeName,managerID, level FROM OrgChart; Is there any way to update the Employees table using a stored procedure rather than building some routine outside of SQL to parse through the data?

    Read the article

  • How to nest transactions nicely - &quot;begin transaction&quot; vs &quot;save transaction&quot; and SQL Server

    - by Brian Biales
    Do you write stored procedures that might be used by others?  And those others may or may not have already started a transaction?  And your SP does several things, but if any of them fail, you have to undo them all and return with a code indicating it failed? Well, I have written such code, and it wasn’t working right until I finally figured out how to handle the case when we are already in a transaction, as well as the case where the caller did not start a transaction.  When a problem occurred, my “ROLLBACK TRANSACTION” would roll back not just my nested transaction, but the caller’s transaction as well.  So when I tested the procedure stand-alone, it seemed to work fine, but when others used it, it would cause a problem if it had to rollback.  When something went wrong in my procedure, their entire transaction was rolled back.  This was not appreciated. Now, I knew one could "nest" transactions, but the technical documentation was very confusing.  And I still have not found the approach below documented anywhere.  So here is a very brief description of how I got it to work, I hope you find this helpful. My example is a stored procedure that must figure out on its own if the caller has started a transaction or not.  This can be done in SQL Server by checking the @@TRANCOUNT value.  If no BEGIN TRANSACTION has occurred yet, this will have a value of 0.  Any number greater than zero means that a transaction is in progress.  If there is no current transaction, my SP begins a transaction. But if a transaction is already in progress, my SP uses SAVE TRANSACTION and gives it a name.  SAVE TRANSACTION creates a “save point”.  Note that creating a save point has no effect on @@TRANCOUNT.  So my SP starts with something like this: DECLARE @startingTranCount int SET @startingTranCount = @@TRANCOUNT IF @startingTranCount > 0 SAVE TRANSACTION mySavePointName ELSE BEGIN TRANSACTION -- … Then, when ready to commit the changes, you only need to commit if we started the transaction ourselves: IF @startingTranCount = 0 COMMIT TRANSACTION And finally, to roll back just your changes so far: -- Roll back changes... IF @startingTranCount > 0 ROLLBACK TRANSACTION MySavePointName ELSE ROLLBACK TRANSACTION Here is some code that you can try that will demonstrate how the save points work inside a transaction. This sample code creates a temporary table, then executes selects and updates, documenting what is going on, then deletes the temporary table. if running in SQL Management Studio, set Query Results to: Text for best readability of the results. -- Create a temporary table to test with, we'll drop it at the end. CREATE TABLE #ATable( [Column_A] [varchar](5) NULL ) ON [PRIMARY] GO SET NOCOUNT ON -- Ensure just one row - delete all rows, add one DELETE #ATable -- Insert just one row INSERT INTO #ATable VALUES('000') SELECT 'Before TRANSACTION starts, value in table is: ' AS Note, * FROM #ATable SELECT @@trancount AS CurrentTrancount --insert into a values ('abc') UPDATE #ATable SET Column_A = 'abc' SELECT 'UPDATED without a TRANSACTION, value in table is: ' AS Note, * FROM #ATable BEGIN TRANSACTION SELECT 'BEGIN TRANSACTION, trancount is now ' AS Note, @@TRANCOUNT AS TranCount UPDATE #ATable SET Column_A = '123' SELECT 'Row updated inside TRANSACTION, value in table is: ' AS Note, * FROM #ATable SAVE TRANSACTION MySavepoint SELECT 'Save point MySavepoint created, transaction count now:' as Note, @@TRANCOUNT AS TranCount UPDATE #ATable SET Column_A = '456' SELECT 'Updated after MySavepoint created, value in table is: ' AS Note, * FROM #ATable SAVE TRANSACTION point2 SELECT 'Save point point2 created, transaction count now:' as Note, @@TRANCOUNT AS TranCount UPDATE #ATable SET Column_A = '789' SELECT 'Updated after point2 savepoint created, value in table is: ' AS Note, * FROM #ATable ROLLBACK TRANSACTION point2 SELECT 'Just rolled back savepoint "point2", value in table is: ' AS Note, * FROM #ATable ROLLBACK TRANSACTION MySavepoint SELECT 'Just rolled back savepoint "MySavepoint", value in table is: ' AS Note, * FROM #ATable SELECT 'Both save points were rolled back, transaction count still:' as Note, @@TRANCOUNT AS TranCount ROLLBACK TRANSACTION SELECT 'Just rolled back the entire transaction..., value in table is: ' AS Note, * FROM #ATable DROP TABLE #ATable The output should look like this: Note                                           Column_A ---------------------------------------------- -------- Before TRANSACTION starts, value in table is:  000 CurrentTrancount ---------------- 0 Note                                               Column_A -------------------------------------------------- -------- UPDATED without a TRANSACTION, value in table is:  abc Note                                 TranCount ------------------------------------ ----------- BEGIN TRANSACTION, trancount is now  1 Note                                                Column_A --------------------------------------------------- -------- Row updated inside TRANSACTION, value in table is:  123 Note                                                   TranCount ------------------------------------------------------ ----------- Save point MySavepoint created, transaction count now: 1 Note                                                   Column_A ------------------------------------------------------ -------- Updated after MySavepoint created, value in table is:  456 Note                                              TranCount ------------------------------------------------- ----------- Save point point2 created, transaction count now: 1 Note                                                        Column_A ----------------------------------------------------------- -------- Updated after point2 savepoint created, value in table is:  789 Note                                                     Column_A -------------------------------------------------------- -------- Just rolled back savepoint "point2", value in table is:  456 Note                                                          Column_A ------------------------------------------------------------- -------- Just rolled back savepoint "MySavepoint", value in table is:  123 Note                                                        TranCount ----------------------------------------------------------- ----------- Both save points were rolled back, transaction count still: 1 Note                                                            Column_A --------------------------------------------------------------- -------- Just rolled back the entire transaction..., value in table is:  abc

    Read the article

  • How do I include 2 tables in LocalStorage?

    - by Noor
    I've got a table that you can edit, and I've got a simple code saving that list when you're done with editing it. (the tables have the contenteditable on) The problem I've stumbled upon is that if I double click on enter, the table gets divided into two separate tables with the same ID. This causes the code I'm using to set the localStorage to only store one of the tables (I assume the first).. I've thought of different solutions and I wonder if someone could point out the pro's and con's (if the solutions even works that is). Make a loop that checks the page after tables and stores them into an array of localStorage-items.. I'd have to dynamically create a localStorage item for each table. Take the whole div that the tables are in, and store that in the localStorage, when a user revisits the page, the page checks after the items in storage and displays the whole divs. Any suggestions you have that can beat this :).. (but no cache, it has to be with the localStorage!) Thanks

    Read the article

  • Need some tips on my SQL script?

    - by Nano HE
    Hi I plan to create a tale to store the race result like this, Place RaceNumber Gender Name Result 12 0112 Male Mike Lee 1:32:40 16 0117 Female Rose Marry 2:20:40 I confused at the items type definiation. Q1.I am not sure the result can be set to varchar(32) or other type? Q2. and for racenumber, between int(11) and varchar(11), which one is better? Q3. Can I use `UNIQUE KEY` like my way? Q4. Do I need split name to firstName and lastName in my DB table? DROP TABLE IF EXISTS `race_result`; CREATE TABLE IF NOT EXISTS `race_result` ( `id` int(11) NOT NULL auto_increment, `racenumber` int(11) NOT NULL, `gender` enum('male','female') NOT NULL, `name` varchar(16) NOT NULL, `result` varchar(32) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `racenumber` (`racenumber`,`id`) ) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 AUTO_INCREMENT=3;

    Read the article

  • XSLT 1.0 count element with the same value in an attribute, and show it

    - by Erick
    I have a variable containing: <col p1="Newman" p2="Paul"/> ... <col p1="Newman" p2="Paolo"/> <col p1="Newman" p2="Paul"/> i wold in output a table with in the first column the value of p2 and in the second the number of time it appear. For each value of p2 should i have only a row. <table> <tr><td>p2</td><td>num</td></tr> <tr><td>Pault</td><td>2</td> ... <tr><td>Paolo</td><td>1</td> </table>

    Read the article

  • How come jQuery can't remove this element?

    - by George Edison
    I have a table like this: <table id='inventory_table'> <tr id='no_items_avail'> <td> There are no items in the database. </td> </tr> </table> And I want to get rid of it with jQuery like this: $('#inventory_table tbody tr#no_items_avail').remove(); However it doesn't seem to be working at all. What am I doing wrong? Edit: Also, the row above was originally inserted into the DOM with another jQuery call: $('#inventory_table tbody').append("<tr id='no_items_avail'....... If that helps. And, running: alert($('#no_items_avail').text()); yields "There are no items in the database." as expected.

    Read the article

  • SQL Simple ORDER BY

    - by AeroDroid
    I'm new to SQL and I don't think this question should be hard to answer. I have a high-score table for a game that contains the columns name, score, and rank. I want to know how I can order the table by descending order each time a new score is added so the table can always stay ordered by score. I know this is the wrong way of doing this, but I hope this makes my point kind of clearer. UPDATE `HSTable`.`Highscores` ORDER BY `Highscores`.`score` DESC; What is the correct way of approaching this? One more thing, is there a way I can set it so that the ranking value always stays where it's suppose to be from the SQL, for example, 1st place is always at the top regardless the score? Thanks!

    Read the article

  • How do I include 2 tables in one LocalStorage item?

    - by Noor
    I've got a table that you can edit, and I've got a simple code saving that list when you're done with editing it. (the tables have the contenteditable on) The problem I've stumbled upon is that if I double click on enter, the table gets divided into two separate tables with the same ID. This causes the code I'm using to set the localStorage to only store one of the tables (I assume the first).. I've thought of different solutions and I wonder if someone could point out the pro's and con's (if the solutions even works that is). Make a loop that checks the page after tables and stores them into an array of localStorage-items.. I'd have to dynamically create a localStorage item for each table. Take the whole div that the tables are in, and store that in the localStorage, when a user revisits the page, the page checks after the items in storage and displays the whole divs. Any suggestions you have that can beat this :).. (but no cache, it has to be with the localStorage!) Thanks

    Read the article

  • SQL: ATER COLUMN to shorter CHAR(n) type

    - by Rising Star
    I'm working with MS SQL SERVER 2003. I want to change a column in one of my tables to have fewer characters in the entries. This is identical to this question: http://stackoverflow.com/questions/2281336/altering-a-table-column-to-accept-more-characters except for the fact that I want fewer characters instead of more. I have a column in one of my tables that holds nine-digit entries. A developer previously working on the table mistakenly set the column to hold ten-digit entries. I need to change the type from CHAR(10) to CHAR(9). Following the instructions from the discussion linked above, I wrote the statement ALTER TABLE [MY_TABLE] ALTER COLUMN [MY_COLUMN] CHAR(9); This returns the error message "String or binary data would be truncated". I see that my nine-digit strings have a space appended to make them ten digits. How do I tell SQL Server to discard the extra space and convert my column to a CHAR(9) type?

    Read the article

  • Getting mysql row that doesn't conflict with another row

    - by user939951
    I have two tables that link together through an id one is "submit_moderate" and one is "submit_post" The "submit_moderate" table looks like this id moderated_by post 1 James 60 2 Alice 32 3 Tim 18 4 Michael 60 Im using a simple query to get data from the "submit_post" table according to the "submit_moderate" table. $get_posts = mysql_query("SELECT * FROM submit_moderate WHERE moderated_by!='$user'"); $user is the person who is signed in. Now my problem is when I run this query, with the user 'Michael' it will retrieve this 1 James 60 2 Alice 32 3 Tim 18 Now technically this is correct however I don't want to retrieve the first row because 60 is associated with Michael as well as James. Basically I don't want to retrieve that value '60'. I know why this is happening however I can't figure out how to do this. I appreciate any hints or advice I can get.

    Read the article

< Previous Page | 72 73 74 75 76 77 78 79 80 81 82 83  | Next Page >