I have 2 tables :
users : contains id and name
friends : contains id1 and id2
Let's suppose I have this data in the users table :
id : 1 , name : FinalDestiny
id : 2 , name : George
And this data in the friends table:
id1: 1 , id2: 2
So this means that 1 is friend with 2.
I need with one single query to say that id1 is friend ...
I have a users table, books table and authors table. An author can have many books, while a user can also have many books. (This is how my DB is currently setup). As I'm pretty new to So far my setup is like bookview.php?book_id=23 from accessing authors page, then seeing all books for the author. The single book's details are all displa...
I have 2 mysql tables :
Question with the following columns : id, question, nranswers
Nranswers must be a number from 1 to 5
And the other table is
Answers with the following columns: questionid, userid, answer .
Now the problem is that I want to get the replies for each answer for one question(id 22 let's say) .
P.S. If the n...
Alright, so I'm putting together a path to select a revision of a particular novel:
SELECT Catalog.WbsId, Catalog.Revision, NovelRevision.Revision
FROM Catalog, BookInCatalog
INNER JOIN NovelMaster
INNER JOIN HasNovelRevision
INNER JOIN NovelRevision
ON HasNovelRevision.right = NovelRevision.obid
ON Has...
Here is my layout,
I am using one div and many spans for getting the above view... Look at all the rows ther are not properly aligned...
<div class="resultsdiv"><br />
<span style="width:200px;" class="resultName">' + employee.Emp_Name + '</span>
<span class="resultfields" style="padding-left:100px;">Category :</span>
<spa...
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 tabl...
Take a look of this image: http://imagebin.ca/img/b-W91wDU.png
I have some CGPath like the image 1 and I would like to know how I can create an inner shadow effect like the image 2
I'm working with objective-c and Core Graphics
iPhone SDK: 3.2
...
I have a simple form setup and I was following how the book, Core Java Vol I, sets up their forms, where they have a top level class that extends JFrame create objects of the different components, and lays them out in the frame. If this isn't the way you are "typically" supposed to do it, please let me know.
I got confused when I wrot...
hello i have problems with this script, i select from 2 tabels but i dont know how to bind the result
i get this error
Fatal error: Call to a member function bind_result() on a non-object
this is my code http://pastebin.com/5sShTSMC
Thanks
...
Hi,
How would I go about writing a constructor for an inner class which is implementing an interface? I know I could make a whole new class, but I figure there's got to be a way to do something along the line of this:
JButton b = new JButton(new AbstractAction() {
public AbstractAction() {
super("This is a button"); ...
Hey,
Say I have 3 classes
class foo1 { List<foo2> prop1;}
class foo2 { foo3 prop2;}
class foo3{ int Id;}
now I want to select distinct foo2's from foo1 and get Id of foo3.
I need to write a HQL stmt for the same.
I tried the following
select c.Id from (select distinct(a.prop1) from foo1.prop1 as a ) as b inner join b.prop2 as c...
I am trying to update a field in my table based on if it exists in two join tables.
update quotes
inner join collection_records ON quotes.id <> collection_records.record_id
inner join subcollection_records ON quotes.id <> subcollection_records.record_id
set quotes.status_id = 1
where collection_records.type = 'Quote'
or subcollectio...
I am using this script, trying to join 2 tables with 3 conditions and update T1:
Update T1 set T1.Inci = T2.Inci
ON T1.Brands = T2.Brands
AND T1.Category= T2.Category
AND T1.Date = T2.Date
but i encounter: Incorrect syntax near the keyword 'ON'. can't figure it out why
...
Hi,
I have a table 1 and table 2.
Table 1
PARTNUM - ID_BRAND
partnum is the primary key
id_brand is "indexed"
Table 2
ID_BRAND - BRAND_NAME
id_brand is the primary key
brand_name is "indexed"
The table 1 contains 1 million of records and the table 2 contains 1.000 records.
I'm trying to optimize some query using EXPLAIN and after a l...
I have 2 tables, 'interests' and 'users_interests'.
'users_interests' just has userid and interestid fields.
'interests just has an id and a name.
I simply need to find userid's who have more than 3 interest ID's in common. I have been told that a Self Join is involved, but I cannot seem to get this to work.
Someone said something ...
Hello again!
I'm a complete newbie to SQL, and I am having problems with what I assume is an easy easy SQL join statement.
I have an "inventory" and an "items" table. The "inventory" table contains a user_id, an item_id, and a qty. The "items" table contains an item_id and and item_name.
I want a user to get a list of all inventory ...
ALTER PROCEDURE [dbo].[GetValues]
@FieldName NVARCHAR(50),
@FormName NVARCHAR(50),
@PoolName NVARCHAR(50)
AS SELECT FieldValue FROM [dbo].[Values]
INNER JOIN [dbo].[Fields]
ON [dbo].[Fields].FieldID = [dbo].[Values].FieldID
INNER JOIN [dbo].[FormFields]
ON [dbo].[FormFields].FieldID = [dbo].[Fields].FieldID
INNER JOIN...
I am trying to figure out how I could extract an inner Xml String from a Xml document.
According to the API there a method VTDNav.getContentFragment() which seems to be the right choice. But this method returns a long. How do I use that long value to retrieve the xml between the two tags?
Any help appreciated. Thanks in advance.
...
public class A {
static class B {
}
}
public class C {
void m(X x) {
if (x instanceof A.B) { ... } // not working
}
}
Is there a way to verify if some object (x) is actually the inner class (B) of some class (A) in this scenario?
I'm getting this error, but I unfortunately have no control over the classes A and B....