Re: Compare the resulta of a count sql into bash

Поиск
Список
Период
Сортировка
От Jasen Betts
Тема Re: Compare the resulta of a count sql into bash
Дата
Msg-id ihrgsm$c74$1@reversiblemaps.ath.cx
обсуждение исходный текст
Ответ на Compare the resulta of a count sql into bash  (manuel antonio ochoa <manuel8aalfaro@gmail.com>)
Список pgsql-sql
On 2011-01-26, manuel antonio ochoa <manuel8aalfaro@gmail.com> wrote:
> --0015174be152ceb275049ac2dc95
> Content-Type: text/plain; charset=ISO-8859-1
>
> Hello,
> I have the next :
>
> COUNTONE=`/var/lib/pgsql/bin/./psql -U 'Thor'   -d princlocal -p 5432 -h
> 192.170.1.82  -c "select count(*) from monterrey.${NOMBRETB}"`
> COUNTTWO=`/var/lib/pgsql/bin/./psql -U 'Thor'   -dprinclocal -p 5432 -h
> 192.170.1.82  -c "select count(*) from monterrey.$nombre where recibo
> between '$FI' and '$FF'"
>
> I want to compare the result countone with countwo  how does it works  ?

you need -t 

COUNTONE=`/var/lib/pgsql/bin/./psql -t -U 'Thor' -d princlocal -p 5432 -h  192.170.1.82  -c "select count(*) from
monterrey.${NOMBRETB}"`
COUNTTWO=`/var/lib/pgsql/bin/./psql -t -U 'Thor' -d princlocal -p 5432 -h 192.170.1.82  -c "select count(*) from
monterrey.$nombrewhere recibo between '$FI' and '$FF'"`
 

or like this:

CONN="user=Thor database=princlocal port=5432 host=192.170.1.82"
PSQL=/var/lib/pgsql/bin/psql
COUNTONE=`$PSQL "$CONN" -t -c "select count(*) from monterrey.${NOMBRETB}"`
COUNTTWO=`$PSQL "$CONN" -t -c "select count(*) from monterrey.$nombre where recibo between '$FI' and '$FF'"`

-- 
⚂⚃ 100% natural


В списке pgsql-sql по дате отправления:

Предыдущее
От: "Santosh Bhujbal (sabhujba)"
Дата:
Сообщение: Re: [GENERAL] Queyring for columns which are exist in table.
Следующее
От: Thom Brown
Дата:
Сообщение: Re: [GENERAL] Queyring for columns which are exist in table.