MySQL Forums
Forum List  »  Newbie

Select Statement
Posted by: Darren Higgins
Date: April 13, 2021 02:20AM

Hello all,

I'm very new to SQL. I'm looking for a little help, please?

I have a select statement similar to the following:
select * from Column_A where ID = '01'

I currently then copy and paste it as follows:
select * from Column_B where ID in (select * from Column_A where ID = '01')

However, I'd like to know is it possible to do something similar to the following instead?

select * from Column_A where ID = '01' as Column_A_ID

select * from Column_B where ID in (Column_A_ID)

I did try to search for this, but as I'm not really sure what to search for, it didn't show any results.

Thank you in advance for any assistance.

Regards,

Options: ReplyQuote


Subject
Written By
Posted
Select Statement
April 13, 2021 02:20AM
April 13, 2021 04:08AM
April 13, 2021 08:34AM


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.