Hi to all,
I created following table
---------------------------------------
crate table publisher(name varchar(20), city varchar(20))
---------------------------------------
I want to run following query.
'list all the positions of charcter 'a' from name.'
for this, i ran following query,
----------------------------------------
select patindex('%a%', name)
from publisher;
---------------------------------------
But, it doesn't show proper output. When i put 'city' column instead of 'name' column, it shows right output. What is the problem?
=======================================
Also, I want to dispaly the name of publishers whose getting minimum and maximum profit. for this, i ran following query,
--------------------------------------
select name, max(profit), min(profit) from publisher;
-------------------------------------
It shows the error like that "'name' is not part of aggregate function". what should i do for retrieving name of publishers who getting minimum and maximum profit.
Thanks & regards,
Pooja.