MySQL Forums
Forum List  »  Newbie

table query
Posted by: JOHN FARRUGIA
Date: July 22, 2005 06:52AM

I have a table(test) as follows:

id|tags|value|readtime
1|part|9090|2005-1-1 1:21:12
2|total|122|2005-1-1 1:21:12
3|part|9090|2005-1-1 1:21:40
4|total|122|2005-1-1 1:21:40

I am looking to search the table and retrieve "readtime" of any row that has a tag value of "part". Then I want to take all the "readtime" values I just extracted and find (in the same table) all rows that contain the same "readtime" value and have tags equal "total"

I.E. select * from test where tags='total' and readtime=(select readtime from test where tag='part')

I get an error with this query "Operand should contain 1 column"

Options: ReplyQuote


Subject
Written By
Posted
table query
July 22, 2005 06:52AM
July 22, 2005 07:16AM
July 22, 2005 07:25AM
July 22, 2005 07:28AM
July 22, 2005 08:14AM
July 22, 2005 08:46AM
July 22, 2005 08:57AM
July 22, 2005 09:26AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.