₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,325,082 members, 8,420,213 topics. Date: Thursday, 04 June 2026 at 01:46 PM

Toggle theme

[Resolved Issue] Sql Syntax Needed - Programming - Nairaland

Nairaland ForumScience/TechnologyProgramming[Resolved Issue] Sql Syntax Needed (966 Views)

1 (Go Down)

[Resolved Issue] Sql Syntax Needed by BigStar1(op): 9:48pm On Nov 20, 2012
Dear everyone, please I need to select some values from a table(A), but those records must not be contained in another table(B). I.e. All records in A that are not in B. Thanks
Re: [Resolved Issue] Sql Syntax Needed by naijaswag1: 1:45pm On Nov 21, 2012
Try using set notation for sql: union,minus or intersect will do that for you. I know these are supported on oracle. For this situation, minus will do.
Re: [Resolved Issue] Sql Syntax Needed by saintiyke(m): 6:28pm On Nov 21, 2012
U can use JOIN or write a subquery. ......... E.g. Using subqueries;
SELECT columnA,....,
FROM TableA
WHERE ( SELECT columnB, ......,
FROM TableB);
Re: [Resolved Issue] Sql Syntax Needed by saintiyke(m): 6:31pm On Nov 21, 2012
saintiyke: U can use JOIN or write a subquery. ......... E.g. Using subqueries;
SELECT columnA,....,
FROM TableA
WHERE ( SELECT columnB, ......,
FROM TableB);
. ....... Represents other columns u might want to select.
Re: [Resolved Issue] Sql Syntax Needed by saintiyke(m): 6:33pm On Nov 21, 2012
In using JOIN, u must know the primary key and the foreign key of each table
Re: [Resolved Issue] Sql Syntax Needed by BigStar1(op): 3:01pm On Nov 22, 2012
Many thanks to you all for your contribution. I have tried using Join before posting it on NL. I was not getting it right. Can you just help me post the query here. Thanks
Re: [Resolved Issue] Sql Syntax Needed by Listener10:
try this if it will work. Select column1,column2,... From tableA Minus Select column1,column2,... From tableB;
Re: [Resolved Issue] Sql Syntax Needed by Nobody: 11:15pm On Nov 22, 2012
I'm learning.
Re: [Resolved Issue] Sql Syntax Needed by saintiyke(m): 8:35am On Nov 23, 2012
Listener10: try this if it will work. Select column1,column2,... From tableA Minus Select column1,column2,... From tableB;
where is the relationship between TableA and TableB ? I dont think it worths trying as u will surely get an error
Re: [Resolved Issue] Sql Syntax Needed by Listener10: 9:12am On Nov 23, 2012
saintiyke: where is the relationship between TableA and TableB ? I dont think it worths trying as u will surely get an error
guy,the op didnt state d relationship btw d two tables. We dont know d structure of the two tables.you can only write out the relationship btw two tables when u know their structures.the op only asked for d syntax and not d actual statement.he'll be d one to complete d statements since he's d only person that knows d structure of d tables.what i gave is just a clue.how do u expect me to know d relationship btw two tables when i dont know d primary key or d foreign keys of d tables
Re: [Resolved Issue] Sql Syntax Needed by Nobody: 10:56am On Nov 23, 2012
Big Star: Dear everyone, please I need to select some values from a table(A), but those records must not be contained in another table(B). I.e. All records in A that are not in B. Thanks
are you trying to select from table A only, the values not in table B
then you may want to use subqueries

SELECT * FROM tableA WHERE tableA.id not in (select id from tableB)
Re: [Resolved Issue] Sql Syntax Needed by BigStar1(op): 3:07pm On Nov 23, 2012
webdezzi: SELECT * FROM tableA WHERE tableA.id not in (select id from tableB)
Wow! Thanks so much. This code works like magic. @moderators, kindly provide a button for marking a post as resolved. Thanks everybody.
Re: [Resolved Issue] Sql Syntax Needed by mitey(m): 11:39am On Nov 24, 2012
Big Star: Wow! Thanks so much. This code works like magic. @moderators, kindly provide a button for marking a post as resolved. Thanks everybody.
Simply modify the topic and add [Solved] at the beginning.

1

Programming Your Own Code Syntax HighlighterJava Syntax Highlighter For Smf 1.0.12Parse Error: Syntax Error, Unexpected T_else In C:\234

NS2 Simulations In Linux OS, Any Idea?Joomla Help AsapStart Your Dream Ecommerce Website