Geekzone: technology news, blogs, forums
Guest
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.


tigercorp

668 posts

Ultimate Geek


#123303 2-Jul-2013 22:00
Send private message

Before anyone asks, this isn't homework, its a potential aid to an unfortunately very real problem :D

I have a query which works fine that goes:
select stuff from table1 where id1 = 'string_id1' and id2 = 'string'

My problem is I have the values for string_id1 and string_id2 in another table i.e table2.  So to be clear, table2 consists of 2 columns called string_id1 and string_id2.

I want the results of the query for each line in table2.  What's the best way to do this?

Create new topic

This is a filtered page: currently showing replies marked as answers. Click here to see full discussion.

tigercorp

668 posts

Ultimate Geek


  #848525 3-Jul-2013 08:47
Send private message

tigercorp: ...

sidefx: Or just use a join: 

http://sqlfiddle.com/#!6/c006c/1


This is what I was originally going for but the select statement is actually a bit more complex containing multiple joined tables already.  I can join my table2 to it but I obviously don't understand the relationships properly and get incorrect data returned.


I've received an (unexpected) early morning answer from one of the development team who has provided the correct JOIN conditions to make this work.

I'll mark this as answered, thanks for all the advice everyone!

Create new topic





News and reviews »

Air New Zealand Starts AI adoption with OpenAI
Posted 24-Jul-2025 16:00


eero Pro 7 Review
Posted 23-Jul-2025 12:07


BeeStation Plus Review
Posted 21-Jul-2025 14:21


eero Unveils New Wi-Fi 7 Products in New Zealand
Posted 21-Jul-2025 00:01


WiZ Introduces HDMI Sync Box and other Light Devices
Posted 20-Jul-2025 17:32


RedShield Enhances DDoS and Bot Attack Protection
Posted 20-Jul-2025 17:26


Seagate Ships 30TB Drives
Posted 17-Jul-2025 11:24


Oclean AirPump A10 Water Flosser Review
Posted 13-Jul-2025 11:05


Samsung Galaxy Z Fold7: Raising the Bar for Smartphones
Posted 10-Jul-2025 02:01


Samsung Galaxy Z Flip7 Brings New Edge-To-Edge FlexWindow
Posted 10-Jul-2025 02:01


Epson Launches New AM-C550Z WorkForce Enterprise printer
Posted 9-Jul-2025 18:22


Samsung Releases Smart Monitor M9
Posted 9-Jul-2025 17:46


Nearly Half of Older Kiwis Still Write their Passwords on Paper
Posted 9-Jul-2025 08:42


D-Link 4G+ Cat6 Wi-Fi 6 DWR-933M Mobile Hotspot Review
Posted 1-Jul-2025 11:34


Oppo A5 Series Launches With New Levels of Durability
Posted 30-Jun-2025 10:15



Geekzone Live »

Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.



Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.