Search Results

Search found 8943 results on 358 pages for 'audit tables'.

Page 35/358 | < Previous Page | 31 32 33 34 35 36 37 38 39 40 41 42  | Next Page >

  • mysql join Two tables to get records

    - by Saranya
    Hai guys, I have two tables Incharge and property. My property table has three fields 1stIncharge,2ndIncharge and 3rdIncharge. InchargeId is set as foreign key for all the above fields in the property table.. How to write a select statement that joins both the table.. I ve tried a bit but no result select P.Id,P.Name,P.1stIncharge,P.2ndIncharge,P.3rdIncharge,I.Id from Property as P join Incharge as I where (\\How to give condition here \\) Guys 3 fields P.1stIncharge, P.2ndIncharge, P.3rdIncharge has foreign key I.Id Edit: select P.Id,P.Name,P.1stIncharge,P.2ndIncharge,P.3rdIncharge,I1.Id from Property as P inner join Incharge as I1 on I1.Id=P.1stIncharge inner join Incharge as I2 on I2.Id=P.2ndIncharge inner join Incharge as I3 on I3.Id=P.3rdIncharge and this query working

    Read the article

  • ado.net slow updating large tables

    - by brett
    The problem: 100,000+ name & address records in an access table (2003). Need to iterate through the table & update detail with the output from a 3rd party dll. I currently use ado, and it works at an acceptable speed (less than 5 minutes on a network share). We will soon need to update to access 2007 and its 'non jet' accdb format to maintain compatability with clients. I've tried using ado.net datsets, but updating the records takes hours! We process 5-10 of these tables per day - so this cannot be a solution. Any ideas on the fastest way to update individual records using ado.net? Surely we didn't take such a hugh backward step with ado.net? Any help would be appreciated.

    Read the article

  • Comparing 2 mysql tables and updating only records that have changed

    - by Roland
    I have the following. Two mysql tables. I want to copy info that has changed from table a to b. For example if row 1 column 2 has changed in table a I want to only update that column in table b. Table b is not the same as a but has same columns that also exist in a. The other solution I have is to just clear table b and replace it with the contents from table a, the problem with this could be that the script will take longer to execute, since there are more than 10000 records. Any advise for which method would work the best will be highly appreciated

    Read the article

  • Need help joining tables...

    - by yuudachi
    I am a MySQL newbie, so sorry if this is a dumb question.. These are my tables. student table: SID (primary) student_name advisor (foreign key to faculty.facultyID) requested_advisor (foreign key to faculty.facultyID) faculty table: facultyID (primary key) advisor_name I want to query a table that shows everything in the student table, but I want advisor and requested_advisor to show up as names, not the ID numbers. so like it displays like this on the webpage: Student Name: Jane Smith SID: 860123456 Current Advisor: John Smith Requested advisor: James Smith not like this Student Name: Jane Smith SID: 860123456 Current Advisor: 1 Requested advisor: 2 SELECT student.student_name, SID, student_email, faculty.advisor_name FROM student INNER JOIN faculty ON student.advisor = faculty.facultyID; this comes out close, but I don't know how to get the requested_advisor to show up as a name.

    Read the article

  • Updating Linking Tables

    - by Sasha
    I've currently adding a bit of functionality that manages holiday lettings on top of a CMS that runs on PHP and MySQL. The CMS stores the property details on a couple of tables, and I'm adding a third table (letting_times) that will contain information about when people are staying at the property. Basic functionality would allow the user to add new times when a guest is staying, edit the times that the guest is staying and remove the booking if the guest no longer wants to stay at the property. Right now the best way that I can think of updating the times that the property is occupied is to delete all the times contained in the letting_times database and reinsert them again. The only other way that I can think to do this would be to include the table's primary key and do an update if that is present and has a value, otherwise do an insert, but this would not delete rows of data if they are removed. Is there a better way of doing this?

    Read the article

  • MySQL - getting SUM of MAX results from 2 tables

    - by SODA
    Hi, Here's my problem: I have 2 identical tables (past month data, current month data) - data_2010_03, data_2010_04: Content_type (VARCHAR), content_id (INT), month_count (INT), pubDate (DATETIME) Data in month_count is updated hourly, so for each combination of content_type and content_id we insert new row, where value of month_count is incrementally updated. Now I try something like this: SELECT MAX(t1.month_count) AS max_1, MAX(t2.month_count) AS max_2, SUM(max_1 + max_2) AS result, t1.content_type, t1.content_id FROM data_2010_03 AS t1 JOIN data_2010_04 AS t2 ON t1.content_type = t2.content_type AND t1.content_id = t2.content_id WHERE t2.pubDate < '2010-04-08' AND t1.content_type = 'video' GROUP BY t1.content_id ORDER BY result desc, max_1 desc, max_2 desc LIMIT 0,10 I get an error "Unknown column 'max_1' in 'field list'. Please help.

    Read the article

  • Compare and find differences in two tables in Oracle

    - by Ruslan
    Hi! i have 2 tables: account: ID, ACC, AE_CCY, DRCR_IND, AMOUNT, MODULE flex: ID, ACC, AE_CCY, DRCR_IND, AMOUNT, MODULE I want to show differences comparing only by: AE_CCY, DRCR_IND, AMOUNT, MODULE and ACC by first 4 characters Example: ID ACC AE_CCY DRCR_IND AMOUNT MODULE -- --------- ------ -------- ------ ------ 1 734647674 USD D 100 OP and in flex: ID ACC AE_CCY DRCR_IND AMOUNT MODULE -- --------- ------ -------- ------ ------ 1 734647654 USD D 100 OP 2 734665474 USD D 100 OP 9 734611111 USD D 100 OP ID's 2 and 9 should be shown as differences. If I use FULL JOIN I'll get no differences as substr(account.ACC,1,4) = substr(flex.ACC,1,4) are equal and others are equal and MINUS doesn't work because ID's different. Thanks.

    Read the article

  • Counting problem: possible sudoko tables?

    - by Sorush Rabiee
    Hi, I'm working on a sudoko solver. my method is using a game tree and explore possible permutations for each set of digits by DFS Algorithm. in order to analyzing problem, i want to know what is the count of possible valid and invalid sudoko tables? - a 9*9 table that have 9 one, 9 two, ... , 9 nine. (this isn't exact duplicate by this question) my solution is: 1- First select 9 cells for 1s: (*) 2- and like (1) for other digits (each time, 9 cells will be deleted from remaining available cells): C(81-9,9) , C(81-9*2,9) .... = 3- finally multiply the result by 9! (permutation of 123456789 in (*)) this is not equal to accepted answer of this question but problems are equivalent. what did i do wrong?

    Read the article

  • Databinding multiple tables linq query to gridview?

    - by Curtis White
    My question is how can I display a linq query in a gridview that has data from multiple tables AND allow the user to edit some of the fields or delete the data from a single table? I'd like to do this with either a linqdatasource or a linq query. I'm aware I can set the e.Result to the query on the selecting event. I've also been able to build a custom databound control for displaying the linq relations (parent.child). However, I'm not sure how I can make this work with delete? I'm thinking I may need to handle the delete event with custom code.

    Read the article

  • SQL select statement from 2 tables

    - by Steven
    Hi, I have a small sql question. I have 2 tables Members and Managers Members has: memberID, Name, Address Managers has: memberID, EditRights, DeleteRights EditRights and DeleteRights are of type bit. Mangers have a relationship with Members, because they are members themselves. I want to select all members id's, name and adress and for the members that are managers show if they have editrights and/or deleterights. SO: Exmaple data Members: ID, Name, Address 1, tom, 2 flat 2, dan, 3 flat 3, ben, 4 flat 4, bob, 6 flat 5, sam, 9 flat Managers: ID, Editrights, deleterights 2, 0, 1 4, 1, 1 5, 0, 0 I would like to display a select like this: 1, tom, 2 flat, no rights 2, dan, 3 flat, Delete 3, ben, 4 flat, no rights 4, bob, 6 flat, Edit&Delete 5, sam, 9 flat, no rights Any help would be great

    Read the article

  • Fill object data from several tables using hibernate mapping

    - by Udo Fholl
    Hi all, I'd like to know if it is possible to fill up a class data from database using the hibernate hbm (mapping). For instance: public class someClass { List<OtherClass> otherClasses; List<YetAnotherClass> yetAnotherClasses; //Constructors ? class OtherClass { String name; //setters, getters } class YetAnotherClass { String name; //setters, getters } //setters, getters } Using an hbm can I fill in the data from tables OTHER_CLASS_TABLE and YET_ANOTHER_CLASS_TABLE? I have no such SOME_CLASS_TABLE since this info is for viewing only. I've been playing with the <join table=""><subselect> and different constructors... But it is not working Thanks! Sorry for my english!

    Read the article

  • mySQL Left Join on multiple tables

    - by Jarrod
    Hi I'm really struggling with this query. I have 4 tables (http://oberto.co.nz/db-sql.png): Invoice_Payement, Invoice, Client and Calendar. I'm trying to create a report by summing up the 'paid_amount' col, in Invoice_Payment, by month/year. The query needs to include all months, even those with no data There query needs the condition (Invoice table): registered_id = [id] I have tried with the below query, which works, but falls short when 'paid_date' does not have any records for a month. The outcome is that month does not show in the results I added a Calendar table to resolved this but not sure how to left join to it. SELECT MONTHNAME(Invoice_Payments.date_paid) as month, SUM(Invoice_Payments.paid_amount) AS total FROM Invoice, Client, Invoice_Payments WHERE Client.registered_id = 1 AND Client.id = Invoice.client_id And Invoice.id = Invoice_Payments.invoice_id AND date_paid IS NOT NULL GROUP BY YEAR(Invoice_Payments.date_paid), MONTH(Invoice_Payments.date_paid) Please see the above link for a basic ERD diagram of my scenario. Thanks for reading. I've posted this Q before but I think I worded it badly.

    Read the article

  • How to have multiple tables with multiple joins

    - by williamsdb
    I have three tables that I need to join together and get a combination of results. I have tried using left/right joins but they don't give the desired results. For example: Table 1 - STAFF id name 1 John 2 Fred Table 2 - STAFFMOBILERIGHTS id staffid mobilerightsid rights --this table is empty-- Table 3 - MOBILERIGHTS id rightname 1 Login 2 View and what I need is this as the result... id name id staffid mobilerightsid rights id rightname 1 John null null null null 1 login 1 John null null null null 2 View 2 Fred null null null null 1 login 2 Fred null null null null 2 View I have tried the following : SELECT * FROM STAFFMOBILERIGHTS SMR RIGHT JOIN STAFF STA ON STA.STAFFID = SMR.STAFFID RIGHT JOIN MOBILERIGHTS MRI ON MRI.ID = SMR.MOBILERIGHTSID But this only returns two rows as follows: id name id staffid mobilerightsid rights id rightname null null null null null null 1 login null null null null null null 2 View Can what I am trying to achieve be done and if so how? Thanks

    Read the article

  • Lua class instance with nested tables

    - by Anonnobody
    Hello, Simple lua game with simple class like so: creature = class({ name = "MONSTER BADDY!", stats = { power = 10, agility = 10, endurance = 10, filters = {} }, other_things = ... }) creatureA = creature.new() creatureB = creature.new() creatureA.name = "Frank" creatureB.name = "Zappa" creatureA.stats.agility = 20 creatureB.stats.power = 12 -- blah blah blah Non table values are individual to each instance, but table values are shared among all instances and if I modify a stats.X value in one instance, all other instances see the same stats table. Q1: Is my OO implementation flawed? I tried LOOP and the same result occured, is there a fundamental flaw in my logic? Q2: How would you have each instance of creature have it's own stats table (and sub tables)? PS. I cannot flatten my class table as it's a bit more complicated than the example and other parts of the code are simplified with this nested table implementation. Thanks a bunch.

    Read the article

  • SQL Query Help Part 2 - Add filter to joined tables and get max value from filter

    - by Seth
    I asked this question on SO. However, I wish to extend it further. I would like to find the max value of the 'Reading' column only where the 'state' is of value 'XX' for example. So if I join the two tables, how do I get the row with max(Reading) value from the result set. Eg. SELECT s.*, g1.* FROM Schools AS s JOIN Grades AS g1 ON g1.id_schools = s.id WHERE s.state = 'SA' // how do I get row with max(Reading) column from this result set The table details are: Table1 = Schools Columns: id(PK), state(nvchar(100)), schoolname Table2 = Grades Columns: id(PK), id_schools(FK), Year, Reading, Writing...

    Read the article

  • SQL SELECT across two tables

    - by Brett Spurrier
    Hi there, I am a little confused as to how to approach this SQL query. I have two takes (equal number of records), and I would like to return a column with which is the division between the two. In other words, here is my not-working-correctly query: SELECT( (SELECT v FROM Table1) / (SELECT DotProduct FROM Table2) ); How would I do this? All I want it a column where each row equals the same row in Table1 divided by the same row in Table2. The resulting table should have the same number of rows, but I am getting something with a lot more rows than the original two tables. I am at a complete loss. Any advice?

    Read the article

  • MVC Entity Model not showing my table

    - by Jessica
    I have a database with multiple tables, and some basic relationships. Here is an example of the problem I am having: My Database: **Org** ID Name etc **Detail1** ID D1name **Org_Detail1** Org_ID Detail1_ID **Detail2** ID D2Name **Org_Detail2** Org_ID Detial1_ID BooleanField My problem is, the Org_detail1 table is not showing up in the entity model, but the Org_Details2 table does. I thought it may have been because the Org_Detail1 table only contains two ID fields that are both primary keys, while the Org_Details2 table contains 2 primary key ID fields as well as a boolean field. If I add a dummy field to Org_detail1 and update it, it still won't show up and wont allow me to add a new entity relating to the Org_Detail1 table. The table won't even show up in the list, but it is listed under the tables. Is there any solution to get this table to appear in my model?

    Read the article

  • Linq for two tables

    - by Diana
    I need to do something like this, My two tables have the same signature, but different class so It suppose to work but it is not working. var myTable; if (booleanVariable == true) { myTable = table1; } else { myTable = table2; } var myLinq1 = from p in myTable join r in myOtherTable select p; In this case, I have to initialize myTable I have tried also, var myTablev= table2; if (booleanVariable == true) { myTable = table1; } var myLinq1 = from p in myTable join r in myOtherTable select p; then var is type table2, then it can't be changed to table1 type. I need help, I don't want to make a copy paste of all the code. the linq query is huge, and it s nested with 5 or 6 queries. also I have to do this on 12 different methods. Thanks a lot for your help.

    Read the article

  • Using Full-Text Search in SQL Server 2005 across multiple tables, columns

    - by crisgomez
    Hi, I have a problem, I created a full text search query which return a record(s), in which the paramater I have supplied match(es) in every fields(full-text indexed) of multiple tables. The problem is , when the user.id is equal to ceritification.AId it returns a records eventhough it was not satisfied with the parameter supplied. For this example I supplied a value "xandrick" which return an Id=184, but the problem is it returns two ids which is 184 and 154.What is the best way to return an ID(s) that satisfied of the supplied given value? User table Id Firstname Lastname Middlename Email AlternativeEmail 154 Gregorio Honasan Pimentel [email protected] [email protected] 156 Qwerty Qazggf fgfgf [email protected]. [email protected] 184 Xandrick Flores NULL [email protected] null Certification table Id AID Certification School 12 184 sdssd AMA 13 43 web-based and framework 2 Asian development foundation college 16 184 hjhjhj STI 17 184 rrrer PUP 18 154 vbvbv AMA SELECT DISTINCT Users.Id FROM Users INNER JOIN Certification on Users.Id=Certification.aid LEFT JOIN FREETEXTTABLE (Users,(Firstname,Middlename,Lastname,Email,AlternativeEmail), 'xandrick' )as ftUsr ON Users.Id=ftUsr.[KEY] LEFT JOIN FREETEXTTABLE (Certification,(Certification,School), 'xandrick' )as ftCert ON Certification.Id=ftCert.[KEY]

    Read the article

  • sql server 2005 - return single row when 2 records in right table

    - by Peanut
    Hi, I have two related sql server tables ... TableA and TableB. ***TableA - Columns*** TableA_ID INT VALUE VARCHAR(100) ***TableB - Columns*** TableB_ID INT TableA_ID INT VALUE VARCHAR(100) For every single record in TableA there are always 2 records in TableB. Therefore TableA has a one-to-many relationship with TableB. How could I write a single sql statement to join these tables and return a single row for each row in TableA that includes: a column for the VALUE column in the first related row in table B a column for the VALUE column in the second related row in table B? Thanks.

    Read the article

  • IIS 7 Can't read data from ASP.Net application services tables

    - by vikp
    Hi, I'm working on deploying a web application written in C# with ASP.Net Application services databases. The application runs fine on the development machine. Windows Server 2003 has been built to test the application. The database has been scripted across using MS SQL Server GUI. ASP.Net application services tables were created using an utility. The connection strings are stored in the web.config and connectionStrings.config. The application connects to the database successfully, but then it times out after 10 seconds.

    Read the article

  • same Linq for two tables

    - by Diana
    I need to do something like this, My two tables have the same signature, but different class so It suppose to work but it is not working. var myTable; if (booleanVariable == true) { myTable = table1; } else { myTable = table2; } var myLinq1 = from p in myTable join r in myOtherTable select p; In this case, I have to initialize myTable I have tried also, var myTable= table2; if (booleanVariable == true) { myTable = table1; } var myLinq1 = from p in myTable join r in myOtherTable select p; then var is type table2, then it can't be changed to table1 type. I need help, I don't want to make a copy paste of all the code. the linq query is huge, and it s nested with 5 or 6 queries. also I have to do this on 12 different methods. Thanks a lot for your help.

    Read the article

  • Search SQL Question Between Related Two Tables

    - by mTuran
    Hi, I am writing some kind of search engine for my web application and i have a problem. I have 2 tables first of is projects table: PROJECTS TABLE id int(11) NO PRI NULL auto_increment employer_id int(11) NO MUL NULL project_title varchar(100) NO MUL NULL project_description text NO NULL project_budget int(11) NO NULL project_allowedtime int(11) NO NULL project_deadline datetime NO NULL total_bids int(11) NO NULL average_bid int(11) NO NULL created datetime NO MUL NULL active tinyint(1) NO MUL NULL PROJECTS_SKILLS TABLE project_id int(11) NO MUL NULL skill_id int(11) NO MUL NULL For example: I want ask this query to database: 1-) Skills are 5 and 7. 2-) Order results by created 3-) project title contains "php" word. 4-) Returned rows should contain projects.* columuns. 5-) Projects should be distinct(i don't want same projects in return of query). Please write sql query that ensure these conditions. Thank You.

    Read the article

  • Adding values from different tables

    - by damdeok
    Friends, I have these tables: Contestant Table: Winner Peter Group Table: Id Name Score Union 1 Bryan 3 77 2 Mary 1 20 3 Peter 5 77 4 Joseph 2 25 5 John 6 77 I want to give additional score of 5 to Peter on Group Table. So, I came up with this query. UPDATE Group SET Score = Score+5 FROM Contestant, Group WHERE Contestant.Winner = Group.Name Now, I want also to give additional score of 5 to the same Union as Peter which is 77. How can I integrate it as one query to my existing query?

    Read the article

  • whats faster, more efficient, loading a js file with arrays or populating arrays from tables

    - by Leigh
    I am rebuilding an ecom site where the product data is stored in a multidimensional JS array that gets loaded on page load. This data is constantly being accessed with JS due to the nature of the site, to update prices based on user selections. There are many options that affect final price. From a programming standpoint, a DB table is much easier to maintain and update than are JS arrays, and since I am porting the site over to PHP and MYSQL, I have been considering moving these arrays into tables. So, would it be better to populate an array from the DB on load so that the pricing data is always available to the JS, or stay with hard coded JS files? I considered getting data via ajax as needed, but since this site has to constantly update pricing with user interaction, I have pretty much ruled that out. How would you handle it?

    Read the article

< Previous Page | 31 32 33 34 35 36 37 38 39 40 41 42  | Next Page >