SQL Server - qry Err - Asked By Jahir on 15-Feb-12 02:04 AM

this qry executing but it shows output just type... not showing output rows ?

select d.type from serviceamount d,creditdeduct e where d.type=e.type

D Company replied to Jahir on 15-Feb-12 02:17 AM
First run the query in sql server and check what it returns, or manualy check in your table

Regards
D
Suchit shah replied to Jahir on 15-Feb-12 02:17 AM
select d.type from serviceamount d,creditdeduct e where d.type=e.type

as in this query you right d.type so it showing type if you need the count then use count word before like below

select Count(d.type) from serviceamount d,creditdeduct e where d.type=e.type
Web Star replied to Jahir on 15-Feb-12 03:13 AM
As you are using the only one column type in select statement so you get the only type instead of the complete rows from table.
If you are talking with data type.... than check you table may be the there are only one row with type column value having "type...." or if there re not  any rows with matching that condition on both table you joined than it return only column name type without any row data simply.
hope this helps you
Venkat K replied to Jahir on 15-Feb-12 03:46 AM
TYPE is a keyword in SQL try embedding the column name in "[" parenthesis

select d.[type] from serviceamount d,creditdeduct e where d.type=e.type

Hope this helps!
kalpana aparnathi replied to Jahir on 15-Feb-12 05:05 AM
hi,

Try like this:

select * from serviceamount d,creditdeduct e where d.type=e.type

Somesh Yadav replied to Jahir on 15-Feb-12 05:14 AM
Hi,

Try to check your table once and than run your query and let me know what it returns.