Search Results

Search found 10235 results on 410 pages for 'inner loop'.

Page 2/410 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • query for inner join of table 4.

    - by amol kadam
    hi.... I'm facing the problem of inner join of table 4 following is query given plz see & give me solution select INSURED.FNAME + ' ' + INSURED.LNAME AS MNAME ,INSURED.MEMBCODE as MEMBERCODE ,INSURED.POLICYNO AS POLICYNO ,INSURED.POLICYFRMDATE AS POLICYFROMDATE ,INSURED.POLICYTODATE AS POLICYTODATE , MEMBERSHIP.MRKEXTNAME AS MARKETINGEXECUTIVE ,MEMBERSHIP.EMPLOYEECOUNT AS EMPLOYEECOUNT ,INSURED.CLAIMID AS CLAIMID ,POLICY.POLICYTYPE ,POLICY.COVAMTHOSPITAL as SUMINSURED ,ORGANIZATION.ORGANIZATIONNAME from ((INSURED inner join MEMBERSHIP on MEMBERSHIP.MEMBERSHIPID=INSURED.MEMBERSHIPID) inner join POLICY on MEMBERSHIP.POLICYNAME=POLICY.POLICYNAME) inner join ORGANIZATION on ORGANIZATION.ORGANIZATIONID=MEMBERSHIP.ORGANIZATIONID WHERE INSUREDID=427

    Read the article

  • Inner Join with more than a field

    - by Leandro
    Precise to do a select with inner join that has relationship in more than a field among the tables Exemple: DataSet dt = new Select().From(SubConta.Schema) .InnerJoin(PlanoContabilSubConta.EmpSubContaColumn, SubConta.CodEmpColumn) .InnerJoin(PlanoContabilSubConta.FilSubContaColumn, SubConta.CodFilColumn) .InnerJoin(PlanoContabilSubConta.SubContaColumn, SubConta.TradutorColumn) .Where(PlanoContabilSubConta.Columns.EmpContabil).IsEqualTo(cEmp) .And(PlanoContabilSubConta.Columns.FilContabil).IsEqualTo(cFil) .And(PlanoContabilSubConta.Columns.Conta).IsEqualTo(cTrad) .ExecuteDataSet(); But the generated sql is wrong: exec sp_executesql N'/* GetDataSet() */ SELECT [dbo].[SubContas].[CodEmp], [dbo].[SubContas].[CodFil], [dbo].[SubContas].[Tradutor], [dbo].[SubContas].[Descricao], [dbo].[SubContas].[Inativa], [dbo].[SubContas].[DataImplantacao] FROM [dbo].[SubContas] INNER JOIN [dbo].[PlanoContabilSubContas] ON [dbo].[SubContas].[CodEmp] = [dbo].[PlanoContabilSubContas].[EmpSubConta] INNER JOIN [dbo].[PlanoContabilSubContas] ON [dbo].[SubContas].[CodFil] = [dbo].[PlanoContabilSubContas].[FilSubConta] INNER JOIN [dbo].[PlanoContabilSubContas] ON [dbo].[SubContas].[Tradutor] = [dbo].[PlanoContabilSubContas].[SubConta] WHERE EmpContabil = @EmpContabil0 AND FilContabil = @FilContabil1 AND Conta = @Conta2 ',N'@EmpContabil0 varchar(1),@FilContabil1 varchar(1),@Conta2 varchar(1)',@EmpContabil0='1',@FilContabil1='1',@Conta2='1' What should be made to generate this sql? exec sp_executesql N'/* GetDataSet() */ SELECT [dbo].[SubContas].[CodEmp], [dbo].[SubContas].[CodFil], [dbo].[SubContas].[Tradutor], [dbo].[SubContas].[Descricao], [dbo].[SubContas].[Inativa], [dbo].[SubContas].[DataImplantacao] FROM [dbo].[SubContas] INNER JOIN [dbo].[PlanoContabilSubContas] ON [dbo].[SubContas].[CodEmp] = [dbo].[PlanoContabilSubContas].[EmpSubConta] AND [dbo].[SubContas].[CodFil] = [dbo].[PlanoContabilSubContas].[FilSubConta] AND [dbo].[SubContas].[Tradutor] = [dbo].[PlanoContabilSubContas].[SubConta] WHERE EmpContabil = @EmpContabil0 AND FilContabil = @FilContabil1 AND Conta = @Conta2 ',N'@EmpContabil0 varchar(1),@FilContabil1 varchar(1),@Conta2 varchar(1)',@EmpContabil0='1',@FilContabil1='1',@Conta2='1'

    Read the article

  • Which is better Java programming practice for looping up to an int value: a converted for-each loop

    - by Arvanem
    Hi folks, Given the need to loop up to an arbitrary int value, is it better programming practice to convert the value into an array and for-each the array, or just use a traditional for loop? FYI, I am calculating the number of 5 and 6 results ("hits") in multiple throws of 6-sided dice. My arbitrary int value is the dicePool which represents the number of multiple throws. As I understand it, there are two options: Convert the dicePool into an array and for-each the array: public int calcHits(int dicePool) { int[] dp = new int[dicePool]; for (Integer a : dp) { // call throwDice method } } Use a traditional for loop. public int calcHits(int dicePool) { for (int i = 0; i < dicePool; i++) { // call throwDice method } } I apologise for the poor presentation of the code above (for some reason the code button on the Ask Question page is not doing what it should). My view is that option 1 is clumsy code and involves unnecessary creation of an array, even though the for-each loop is more efficient than the traditional for loop in Option 2. Thanks in advance for any suggestions you might have.

    Read the article

  • SQL – Difference Between INNER JOIN and JOIN

    - by Pinal Dave
    Here is the follow up question to my earlier question SQL – Difference between != and Operator <> used for NOT EQUAL TO Operation. There was a pretty good discussion about this subject earlier and lots of people participated with their opinion. Though the answer was very simple but the conversation was indeed delightful and was indeed very informative. In this blog post I have another following up question to all of you. What is the difference between INNER JOIN and JOIN? If you are working with database you will find developers use above both the kinds of the joins in their SQL Queries. Here is the quick example of the same. Query using INNER JOIN SELECT * FROM Table1 INNER JOIN  Table2 ON Table1.Col1 = Table2.Col1 Query using JOIN SELECT * FROM Table1 JOIN  Table2 ON Table1.Col1 = Table2.Col1 The question is what is the difference between above two syntax. Here is the answer – They are equal to each other. There is absolutely no difference between them. They are equal in performance as well as implementation. JOIN is actually shorter version of INNER JOIN. Personally I prefer to write INNER JOIN because it is much cleaner to read and it avoids any confusion if there is related to JOIN. For example if users had written INNER JOIN instead of JOIN there would have been no confusion in mind and hence there was no need to have original question. Here is the question back to you - Which one of the following syntax do you use when you are inner joining two tables – INNER JOIN or JOIN? and Why? Reference: Pinal Dave (http://blog.sqlauthority.com) Filed under: PostADay, SQL, SQL Authority, SQL Joins, SQL Query, SQL Server, SQL Tips and Tricks, T SQL, Technology

    Read the article

  • What is so bad about using SQL INNER JOIN

    - by Stephen B. Burris Jr.
    Everytime a database diagram gets looked out, one area people are critical of is inner joins. They look at them hard and has questions to see if an inner join really needs to be there. Simple Library Example: A many-to-many relationship is normally defined in SQL with three tables: Book, Category, BookCategory. In this situation, Category is a table that contains two columns: ID, CategoryName. In this situation, I have gotten questions about the Category table, is it need? Can it be used as a lookup table, and in the BookCategory table store the CategoryName instead of the CategoryID to stop from having to do an additional INNER JOIN. (For this question, we are going to ignore the changing, deleting of any CategoryNames) The question is, what is so bad about inner joins? At what point is doing them a negative thing (general guidelines like # of transactions, # of records, # of joins in a statement, etc)?

    Read the article

  • Using foreach loop.

    - by Harikrishna
    I break the code of the for loop without using break like I have for loop given below.And when i is 1 or 2 or 3 or any else but if condition is true then loop will be terminated because i will be 5 if the condition is true.And so NO need of break is needed there.Beacause I do not want to use break.I have done like this here.It works. bool myCondition=false; for(int i=0;i<5;i++) { if(myCondition) { i=5; } } But now I want to use foreach loop and in this loop when some condition is true then I want to break the foreach loop code.So what should I do here for breaking the foreach loop code without using break ? Like in the above for loop I have initialize i to 5 when condition is true.In the foreach loop anything like that to do to avoid break.

    Read the article

  • Does C# support inner classes? [closed]

    - by Amy
    Possible Duplicates: Using Inner classes in C# Inner classes in C# Class declared inside of another class in C# Does C# support the concept of inner classes? If so, what are the benefits? Could someone please explain this to me?

    Read the article

  • SQL 2 INNER JOINS with 3 tables

    - by Jelmer Holtes
    I've a question about a SQL query.. I'm building a prototype webshop in ASP.NET Visual Studio. Now I'm looking for a solution to view my products. I've build a database in MS Access, it consists of multiple tables. The tables which are important for my question are: Product Productfoto Foto Below you'll see the relations between the tables For me it is important to get three datatypes: Product title, price and image. The product title, and the price are in the Product table. The images are in the Foto table. Because a product can have more than one picture, there is a N - M relation between them. So I've to split it up, I did it in the Productfoto table. So the connection between them is: product.artikelnummer -> productfoto.artikelnummer productfoto.foto_id -> foto.foto_id Then I can read the filename (in the database: foto.bestandnaam) I've created the first inner join, and tested it in Access, this works: SELECT titel, prijs, foto_id FROM Product INNER JOIN Productfoto ON product.artikelnummer = productfoto.artikelnummer But I need another INNER JOIN, how could I create that? I guess something like this (this one will give me an error) SELECT titel, prijs, bestandnaam FROM Product (( INNER JOIN Productfoto ON product.artikelnummer = productfoto.artikkelnummer ) INNER JOIN foto ON productfoto.foto_id = foto.foto_id) Can anyone help me?

    Read the article

  • multple inner joins 3 or more crashes mysql server 5.1.30 opensolaris

    - by user331849
    when doing simple query on 4 inner joined tables, the server crashes with the output below appearing in the the mysql .err file. eg. select * from table1 inner join table2 on table1.a = table2.a and table1.b = table2.b inner join table3 on table2.a = table3.a and table2.c = table3.c inner join table4 on table3.a = table4.a and table3.d = table4.d If i remove one of the tables it executes fine. Likewise if I remove a different table, it executes fine. Though all tables have been checked anyway, this would suggest that it is not a problem specifically with one of the tables. mysql.err trace: 100503 18:13:19 - mysqld got signal 11 ; This could be because you hit a bug. It is also possible that this binary or one of the libraries it was linked against is corrupt, improperly built, or misconfigured. This error can also be caused by malfunctioning hardware. We will try our best to scrape up some info that will hopefully help diagnose the problem, but since we have already crashed, something is definitely wrong and this may fail. key_buffer_size=1572864000 read_buffer_size=2097152 max_used_connections=11 max_threads=151 threads_connected=10 It is possible that mysqld could use up to key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 2155437 K bytes of memory Hope that's ok; if not, decrease some variables in the equation. thd: 0x72febda8 Attempting backtrace. You can use the following information to find out where mysqld died. If you see no messages after this, something went terribly wrong... stack_bottom = fe07efb0 thread_stack 0x40000 Trying to get some variables. Some pointers may be invalid and cause the dump to abort... thd-query at be1021f0 = explain select * from business inner join timetable on business.id = timetable.business_id inner join timetableentry on timetable.business_id = timetableentry.business_id and timetable.kid = timetableentry.parent inner join staff on timetable.business_id = staff.business_id and timetable.staf f_person = staff.kid where business.id = '3050bb04fda41df64a9c1c149150026c' thd-thread_id=9 thd-killed=NOT_KILLED The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains information that should help you find out what is causing the crash. 100503 18:13:19 mysqld_safe mysqld restarted 100503 18:13:20 InnoDB: Failed to set DIRECTIO_ON on file ./ibdata1: OPEN: Inap propriate ioctl for device, continuing anyway 100503 18:13:20 InnoDB: Failed to set DIRECTIO_ON on file ./ibdata1: OPEN: Inap propriate ioctl for device, continuing anyway InnoDB: The log sequence number in ibdata files does not match InnoDB: the log sequence number in the ib_logfiles! 100503 18:13:20 InnoDB: Database was not shut down normally! InnoDB: Starting crash recovery. InnoDB: Reading tablespace information from the .ibd files... InnoDB: Restoring possible half-written data pages from the doublewrite InnoDB: buffer... InnoDB: Last MySQL binlog file position 0 2731, file name ./mysql-bin.000093 100503 18:13:20 InnoDB: Started; log sequence number 0 2650338426 100503 18:13:20 [Note] Recovering after a crash using mysql-bin 100503 18:13:20 [Note] Starting crash recovery... 100503 18:13:20 [Note] Crash recovery finished. This on opensolaris SunOS 5.11 snv_111b i86pc i386 i86pc Mysql 5.1.30 Here is a snippet from the my.cnf file: key_buffer = 1500M max_allowed_packet = 1M thread_stack = 256K thread_cache_size = 8 sort_buffer_size = 2M read_buffer_size = 2M read_rnd_buffer_size = 8M table_cache = 512 tmp_table_size = 400M max_heap_table_size = 64M query_cache_limit = 20M query_cache_size = 200M Is this a bug or a configuration issue?

    Read the article

  • creating arrays in for loops.... without creating an endless loop that ruins my day!

    - by Peter
    Hey Guys, Im starting with a csv varible of column names. This is then exploded into an array, then counted and tossed into a for loop that is supposed to create another array. Every time I run it, it goes into this endless loop that just hammers away at my browser...until it dies. :( Here is the code.. $columns = 'id, name, phone, blood_type'; <code> $column_array = explode(',',$columns); $column_length = count($column_array); //loop through the column length, create post vars and set default for($i = 0; $i <= $column_length; $i++) { //create the array iSortCol_1 => $column_array[1]... $array[] = 'iSortCol_'.$i = $column_array[0]; } </code> What I would like to get out of all this is a new array that looks like so.. <code> $goal = array( "iSortCol_1" => "id", "iSortCol_2" => "name", "iSortCol_3" => "phone", "iSortCol_4" => "blood_type" ); </code>

    Read the article

  • INNER JOIN code calculated value with SELECT statement

    - by sp-1986
    I have the following stored procedure which will generate mon to sun and then creates a temp table with a series of 'weeks' (start and end weeks) : USE [test_staff] GO /****** Object: StoredProcedure [dbo].[sp_timesheets_all_staff_by_week_by_job_grouping_by_site] Script Date: 03/21/2012 09:04:49 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE PROCEDURE [dbo].[sp_timesheets_all_staff_by_week_by_job_grouping_by_site] ( @grouping_ref int, @week_ref int ) AS CREATE TABLE #WeeklyList ( Start_Week date, End_Week date, week_ref int --month_name date ) DECLARE @REPORT_DATE DATETIME, @WEEK_BEGINING VARCHAR(10) SELECT @REPORT_DATE = '2011-01-19T00:00:00' --SELECT @REPORT_DATE = GETDATE() -- should grab the date now. SELECT @WEEK_BEGINING = 'MONDAY' IF @WEEK_BEGINING = 'MONDAY' SET DATEFIRST 1 ELSE IF @WEEK_BEGINING = 'TUESDAY' SET DATEFIRST 2 ELSE IF @WEEK_BEGINING = 'WEDNESDAY' SET DATEFIRST 3 ELSE IF @WEEK_BEGINING = 'THURSDAY' SET DATEFIRST 4 ELSE IF @WEEK_BEGINING = 'FRIDAY' SET DATEFIRST 5 ELSE IF @WEEK_BEGINING = 'SATURDAY' SET DATEFIRST 6 ELSE IF @WEEK_BEGINING = 'SUNDAY' SET DATEFIRST 7 DECLARE @WEEK_START_DATE DATETIME, @WEEK_END_DATE DATETIME --GET THE WEEK START DATE SELECT @WEEK_START_DATE = @REPORT_DATE - (DATEPART(DW, @REPORT_DATE) - 1) --GET THE WEEK END DATE SELECT @WEEK_END_DATE = @REPORT_DATE + (7 - DATEPART(DW, @REPORT_DATE)) PRINT 'Week Start: ' + CONVERT(VARCHAR, @WEEK_START_DATE) PRINT 'Week End: ' + CONVERT(VARCHAR, @WEEK_END_DATE) DECLARE @Interval int = datediff(WEEK,getdate(),@WEEK_START_DATE)+1 --SELECT Start_Week=@WEEK_START_DATE --, End_Week=@WEEK_END_DATE --INTO #WeekList INSERT INTO #WeeklyList SELECT Start_Week=@WEEK_START_DATE, End_Week=@WEEK_END_DATE WHILE @Interval <= 0 BEGIN set @WEEK_START_DATE=DATEADD(WEEK,1,@WEEK_START_DATE) set @WEEK_END_DATE=DATEADD(WEEK,1,@WEEK_END_DATE) INSERT INTO #WeeklyList values (@WEEK_START_DATE,@WEEK_END_DATE) SET @Interval += 1; END SELECT CONVERT(VARCHAR(11), Start_Week, 106) AS 'month_name', CONVERT(VARCHAR(11), End_Week, 106) AS 'End', DATEDIFF(DAY, 0, Start_Week) / 7 AS week_ref -- create the unique week reference number --'VIEW' AS month_name FROM #WeeklyList In this section i am creating the week_ref DATEDIFF(DAY, 0, Start_Week) / 7 AS week_ref -- create the unique week reference number I then need to combine it with this select code: DECLARE @YearString char(3) = CONVERT(char(3), SUBSTRING(CONVERT(char(5), @week_ref), 1, 3)) DECLARE @MonthString char(2) = CONVERT(char(2), SUBSTRING(CONVERT(char(5), @week_ref), 4, 2)) --Convert: DECLARE @Year int = CONVERT(int, @YearString) + 1200 DECLARE @Month int = CONVERT(int, @MonthString) **--THIS FILTERS THE REPORT** SELECT ts.staff_member_ref, sm.common_name, sm.department_name, DATENAME(MONTH, ts.start_dtm) + ' ' + DATENAME(YEAR, ts.start_dtm) AS month_name, ts.timesheet_cat_ref, cat.desc_long AS timesheet_cat_desc, grps.grouping_ref, grps.description AS grouping_desc, ts.task_ref, tsks.task_code, tsks.description AS task_desc, ts.site_ref, sits.description AS site_desc, ts.site_ref AS Expr1, CASE WHEN ts .status = 0 THEN 'Pending' WHEN ts .status = 1 THEN 'Booked' WHEN ts .status = 2 THEN 'Approved' ELSE 'Invalid Status' END AS site_status, ts.booked_time AS booked_time_sum, start_dtm, CONVERT(varchar(20), start_dtm, 108) + ' ' + CONVERT(varchar(20), start_dtm, 103) AS start_dtm_text, booked_time, end_dtm, CONVERT(varchar(20), end_dtm, 108) + ' ' + CONVERT(varchar(20), end_dtm, 103) AS end_dtm_text FROM timesheets AS ts INNER JOIN timesheet_categories AS cat ON ts.timesheet_cat_ref = cat.timesheet_cat_ref INNER JOIN timesheet_tasks AS tsks ON ts.task_ref = tsks.task_ref INNER JOIN timesheet_task_groupings AS grps ON tsks.grouping_ref = grps.grouping_ref INNER JOIN timesheet_sites AS sits ON ts.site_ref = sits.site_ref INNER JOIN vw_staff_members AS sm ON ts.staff_member_ref = sm.staff_member_ref WHERE (ts.status IN (1, 2)) AND (cat.is_leave_category = 0) GROUP BY ts.staff_member_ref, sm.common_name, sm.department_name, DATENAME(MONTH, ts.start_dtm), DATENAME(YEAR, ts.start_dtm), ts.timesheet_cat_ref, cat.desc_long, grps.grouping_ref, grps.description, ts.status, ts.booked_time, ts.task_ref, tsks.task_code, tsks.description, ts.site_ref, sits.description, ts.start_dtm, ts.end_dtm ORDER BY sm.common_name, timesheet_cat_desc, tsks.task_code, site_desc DROP TABLE #WeeklyList GO I want to pass the week_ref into the SELECT statement (refer to comment - THIS FILTERS THE REPORT) but the problem is week_ref isnt a valid column as its derived by code. Any ideas?

    Read the article

  • [Android] For-Loop Performance Oddity

    - by Jack Holt
    I just noticed something concerning for-loop performance that seems to fly in the face of the recommendations given by the Google Android team. Look at the following code: package com.jackcholt; import android.app.Activity; import android.os.Bundle; import android.util.Log; public class Main extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); loopTest(); finish(); } private void loopTest() { final long loopCount = 1228800; final int[] image = new int[8 * 320 * 480]; long start = System.currentTimeMillis(); for (int i = 0; i < (8 * 320 * 480); i++) { image[i] = i; } for (int i = 0; i < (8 * 320 * 480); i++) { image[i] = i; } Log.i("loopTest", "Elapsed time (recompute loop limit): " + (System.currentTimeMillis() - start)); start = System.currentTimeMillis(); for (int i = 0; i < 1228800; i++) { image[i] = i; } for (int i = 0; i < 1228800; i++) { image[i] = i; } Log.i("loopTest", "Elapsed time (literal loop limit): " + (System.currentTimeMillis() - start)); start = System.currentTimeMillis(); for (int i = 0; i < loopCount; i++) { image[i] = i; } for (int i = 0; i < loopCount; i++) { image[i] = i; } Log.i("loopTest", "Elapsed time (precompute loop limit): " + (System.currentTimeMillis() - start)); } } When I run this code I get the following output in logcat: I/loopTest( 726): Elapsed time (recompute loop limit): 759 I/loopTest( 726): Elapsed time (literal loop limit): 755 I/loopTest( 726): Elapsed time (precompute loop limit): 1317 As you can see the code that seems to recompute the loop limit value on every iteration of the loop compares very well to the code that uses a literal value for the loop limit. However, the code that uses a variable which contains the precomputed value for the loop limit is significantly slower than either of the others. I'm not surprised that accessing a variable should be slower that using a literal but why does code that looks like it should be using two multiply instructions on every iteration of the loop so comparable in performance to a literal? Could it be that because literals are the only thing being multiplied, the Java compiler is optimizing out the multiplication and using a precomputed literal?

    Read the article

  • MySQL Dynamicly determine the tabel to use with inner join

    - by user366990
    He guys, I'm stuck with a problem and I hope someone can help me out. I have a date. For example 2009-10-1. This date is used to check in which season I am working. This could be summer or winter. If whe are in the summer the table to use for my inner join whould be 'summer09_rooms'. If winter 'winter09_rooms'. So I basicly whant to do a CASE WHEN in my INNER JOIN. How to accomplish this. The query would look like this: SELECT name, arrival_date, departure_date FROM holliday a INNER JOIN ( CASE when arrival_date BETWEEN 2009-10-1 AND 2009-4-1 THEN summer09_rooms b ELSE winter09_rooms b END ) ON a.dossier=b.dossier Of course this query isn't working but now I hope you'l see what I want to accomplish. Kind regards, Digital Human

    Read the article

  • How to override inner class methods if the inner class is defined as a property of the top class

    - by Maddy
    I have a code snippet like this class A(object): class b: def print_hello(self): print "Hello world" b = property(b) And I want to override the inner class b (please dont worry about the lowercase name) behaviour. Say, I want to add a new method or I want to change an existing method, like: class C(A): class b(A.b): def print_hello(self): print "Inner Class: Hello world" b = property(b) Now if I create C's object as c = C(), and call c.b I get TypeError: 'property' object is not callable error. How would I get pass this and call print_hello of the extended inner class? Disclaimer: I dont want to change the code for A class.

    Read the article

  • Python:How to override inner class methods if the inner class is defined as a property of the top cl

    - by Maddy
    I have a code snippet like this class A(object): class b: def print_hello(self): print "Hello world" b = property(b) And I want to override the inner class 'b'(please dont worry about the lowercase name) behaviour. Say, I want to add a new method or I want to change an existing method, like: class C(A): class b(A.b): def print_hello(self): print "Inner Class: Hello world" b = property(b) Now if I create C's object as c = C(), and call c.b I get TypeError: 'property' object is not callable error. How would I get pass this and call print_hello of the extended inner class? Disclaimer: I dont want to change the code for A class.

    Read the article

  • Double Inner Join generates unexpected error

    - by Itamar Marom
    In my database I have three tables: Users: UserID (Auto Numbering), UserName, UserPassword and a few other unimportant fields. PrivateMessages: MessageID (Auto Numbering), SenderID and a few other fields defining the message content. MessageStatus: MessageID, ReceiverID, MessageWasRead (Boolean) What I need is a query to which I input a user's id and I get all the private messages he has received. In addition, I also need to receive each message's sender UserName. For this I wrote the following query: SELECT Users.*, PrivateMessages.*, MessageStatus.* FROM PrivateMessages INNER JOIN Users ON PrivateMessages.SenderID = Users.UserID INNER JOIN MessageStatus ON PrivateMessages.MessageID = MessageStatus.MessageID WHERE MessageStatus.ReceiverID=[@userid]; But for some reason when I try saving it in my Access database, I get the following error (translated to English by me, since my office is in a different language): Syntax error (missing operator) at expression: "PrivateMessages.SenderID = Users.UserID INNER JOIN MessageStatus ON PrivateMessages.MessageID = MessageStatus.MessageI". Any ideas what could cause this? Thanks.

    Read the article

  • Can I pull the next element from within a Perl foreach loop?

    - by Thilo
    Can I do something like the following in Perl? foreach (@tokens) { if (/foo/){ # simple case, I can act on the current token alone # do something next; } if (/bar/) { # now I need the next token, too # I want to read/consume it, advancing the iterator, so that # the next loop iteration will not also see it my $nextToken = ..... # do something next; } }

    Read the article

  • How do I code a loop for my echo statements?

    - by ggg
    <?php defined('_JEXEC') or die('Restricted access'); $db =& JFactory::getDBO(); $query0 = "SELECT * FROM `#__chesspositions` WHERE . . . . ."; //echo $query0; $db->setQuery($query0); $ginfo = $db->loadObjectList(); //echo $ginfo[0]; echo $db->getErrorMsg(); if(empty($ginfo)){ echo "<center><h2 style='color:navy'>No game found, we apologize</h2></center>"; }else{ $query1= "SELECT * FROM `#__chessmoves` WHERE Id='".$ginfo[0]->MoveDataId."'"; $db->setQuery($query1); echo $db->getErrorMsg(); $gmove = $db->loadObjectList(); } //define array; //how do I code a foreach loop (or any other type of loop) here? //I'm having trouble properly defining the array and structuring the syntax. echo "[Event \"".$ginfo[0]->Event."\"]\n"; echo "[Site \"".$ginfo[0]->Site."\"]\n"; echo "[Date \"".$ginfo[0]->Date."\"]\n"; echo "[Round \"".$ginfo[0]->Round."\"]\n"; echo "[White \"".$ginfo[0]->White."\"]\n"; echo "[Black \"".$ginfo[0]->Black."\"]\n"; echo "[Result \"".$ginfo[0]->Result."\"]\n"; echo "[ECO \"".$ginfo[0]->ECO."\"]\n"; echo "[WhiteElo \"".$ginfo[0]->WhiteElo."\"]\n"; echo "[BlackElo \"".$ginfo[0]->BlackElo."\"]\n"; echo "[Annotator \"".$ginfo[0]->Annotator."\"]\n"; echo "[SetUp \"".$ginfo[0]->SetUp."\"]\n"; echo $gmove[0]->MoveData; ?>

    Read the article

  • INNER JOIN syntax for mySQL using phpmyadmin

    - by David van Dugteren
    SELECT Question.userid, user.uid FROM `question` WHERE NOT `userid`=2 LIMIT 0, 60 INNER JOIN `user` ON `question`.userid=`user`.uid ORDER BY `question`.userid returns Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INNER JOIN User ON question.userid=user.uid ORDER BY question.userid' at line 5 Can't for the life of me figure out what I'm doing wrong here.

    Read the article

  • Java Inner Classes

    - by ikurtz
    im new to Java and have the following question regarding inner classes: when implementing a inner class do i need to declare its attributes and methods scope i.e. public, private, protected?

    Read the article

  • How does java implement inner class closures?

    - by thecoop
    In Java an anonymous inner class can refer to variables in it's local scope: public class A { public void method() { final int i = 0; doStuff(new Action() { public void doAction() { Console.printf(i); // or whatever } }); } } My question is how is this actually implemented? How does i get to the anonymous inner doAction implementation, and why does it have to be final?

    Read the article

  • Class accessing inner class privates?

    - by aloh
    Class Outer { ... private class Node { private T data; ... private T getData() { return data; } } } What's the purpose of using set and get methods if the outer class can access inner class private members? What's the purpose of making inner classes private? Package access?

    Read the article

  • Computer still in boot loop

    - by user2856410
    My computer is in a boot loop and despite all my efforts, I haven't been able to load windows XP with it. When the computer loads, I see some white loading bar at the bottom, then the windows XP loading screen, then the DELL boot screen, then windows XP loading screen, and it just keeps looping. The blue screen error is: UNMOUNTABLE_BOOT_VOLUME Stop: 0x000000ED (0x823D6C08, 0xC000009C, 0x000000000, 0x000000000) I have booted using Hiren's mini XP, and ran CHKDSK /f /r, but it didn't affect the boot loop. Is there anything else I can try to get my computer to start up? I don't have my windows XP disc, but I have a dvd burner on another computer, and can burn a downloaded ISO if it could help me get out of this loop. Thanks!

    Read the article

  • Compile error on inheritance of generic inner class extending with bounds

    - by Arne Burmeister
    I have a problem when compiling a generic class with an inner class. The class extends a generic class, the inner class also. Here the interface implemented: public interface IndexIterator<Element> extends Iterator<Element> { ... } The generic super class: public abstract class CompoundCollection<Element, Part extends Collection<Element>> implements Collection<Element> { ... protected class CompoundIterator<Iter extends Iterator<Element>> extends ImmutableIterator<Element> { ... } } The generic subclass with the compiler error: public class CompoundList<Element> extends CompoundCollection<Element, List<Element>> implements List<Element> { ... private class CompoundIndexIterator extends CompoundIterator<IndexIterator<Element>> implements IndexIterator<Element> { ... } } The error is: type parameter diergo.collect.IndexIterator<Element> is not within its bound extends CompoundIterator<IndexIterator<Element>> ^ What is wrong? The code compiles with eclipse, but bot with java 5 compiler (I use ant with java 5 on a mac and eclipse 3.5). No, I cannot convert it to a static inner class.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >