Page 1 of 2

sql query

PostPosted: Mon Jun 04, 2012 7:53 pm
by surime72
hi guys,
SELECT A.col1, A.col2, A.col3,
A.col4, A.col5, A.col6, A.col7
FROM table A, table B
WHERE A.col1 <> B.col1(of table B),
while i was running this query fetching huge data

Re: sql query

PostPosted: Mon Jun 04, 2012 7:56 pm
by surime72
from the above query i need data from only one table ie:table1

Re: sql query

PostPosted: Mon Jun 04, 2012 8:20 pm
by Akatsukami
surime72 wrote:hi guys,
SELECT A.col1, A.col2, A.col3,
A.col4, A.col5, A.col6, A.col7
FROM table A, table B
WHERE A.col1 <> B.col1(of table B),
while i was running this query fetching huge data

And your point is...?

Re: sql query

PostPosted: Tue Jun 05, 2012 8:11 am
by dick scherrer
Hello,

You will get more useul replies if you explain what you "have" and what you "want".

Show some sample table input (relevant columns only) and the result you want from your query when processed.

If you are unwilling to post some sample data and the output requirement, the most i can offer is to write a query that refers to only 1 table and has a rather restrictive WHERE. . .

Re: sql query

PostPosted: Tue Jun 05, 2012 12:19 pm
by surime72
the query displaying huge data with repeted data from tables

Re: sql query

PostPosted: Tue Jun 05, 2012 12:31 pm
by surime72
hi can please tel
select DISTINCT T1.NO FROM TABLE1 T1
LEFT JOIN TABLE2 T2 USING (NO) WHERE T2.NO IS NULL canany tel what is wrong from above query

i need to fetch non joining of table t1

Re: sql query

PostPosted: Tue Jun 05, 2012 1:37 pm
by GuyC
A course in SQL would be useful :
SELECT A.col1, A.col2, A.col3,
A.col4, A.col5, A.col6, A.col7
FROM tableA A
WHERE not exists (select * from tableB B where  B.col1 = A.col1)

Re: sql query

PostPosted: Tue Jun 05, 2012 3:05 pm
by surime72
hi guyc
i was tried the query it also fetching huge data from table.....
thank u....

Re: sql query

PostPosted: Tue Jun 05, 2012 3:39 pm
by GuyC
maybe tell us
- how the tables look like
- how they are related
- exacactly what you want
and then maybe we could help you.
or give some example rows of A and B and what you expect as the output : which rows you want to see, which rows you don't want to see.

Re: sql query

PostPosted: Tue Jun 05, 2012 4:11 pm
by surime72
SELECT A.I_PART, A.I_RCPT_CHNG_LVL, A.I_PO,
A.X_RCPT_COMNT, A.I_MATL_DOCU, A.Q_GOODS_RECVD, A.D_GOODS_RECVD
FROM EPPS.EOGPREC A WHERE NOT EXISTS (SELECT * FROM PRDT.TBPART04 B
WHERE A.I_PART = B.PART_NO

i need non matching rows of table eogprec
iwas trying to fetch these values to ispf screens
it showing error as ISPP113 Unable to get save area - Additional storage needed is unavailable
for display processing