I have a query in which I need to find all the rows with a specific column being null.
Ex:
select count(*) from proposal_review_info where reviewerid='xyz' and status=1 and review_result='';
the above query does not work. What is the correct solution for the above query?
That's great. It works for my requirement. I only have to add few more conditions in that. But it works !! Thank you very much. Since I just started with Postgresql, I couldn't have done this query without proper reading. Thanks for the help. It saved my time. But definitely I need to read and...
I understand it's a problem. But our requirement is that the proposalid should be a unique value which is autoincrementing but with a prefix x6a (name x6a has some significance). I am trying to find a best logic which would perform well without any hassels. If you think fo any good alternative...
Hi,
In my table I have a primary key column proposaid which will take values like
x6a1
x6a2
.
.
.
x6a10
.
.
In order to insert a unique proposalid (kind of auto increment but with varchar type), I was doing
select max(proposalid) from proposalinfo;
But now I found that once proposalid reaches...
Hi,
I have not done it the way you exlained. Could you please tell me how I could do self join and extract the rows belonging in the range of only 12 months?
Hi,
I have a table which has 3 fields.
reviewerid varchar(20),
proposalid varchar(20),
dt timestamp without time zone
I would like to know how I can select proposalid's belonging to a particular reviewerid for the span of 12 months?
Is it possible to get the difference in dates when it;s a...
I wanted this option for the insert as my html form order differs from the one in the table. While inserting it's easy for me to look at the form and insert it without worriying about the order of the column. anyway, as you said this is not that important.
You mean to say, you specify each...
Hi,
this is a stupid question but still I am curious to know. when I alter the table for adding an additional column to the table, can I add the column into a specific position? Say I have columns
a varchar(20)
b integer
d boolean
If I add a column c varchar(20) can I add after column b ? By...
Hi,
I have 2 questions.
1. I need to define a column in one of my postgresql table. This column can have integer values from 1-999. Which is the best datatype, varchar or smallint?Considering the disk space occupied.
2. Is it possible to have custom built value for a column of type SERIAL. For...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.